The .NetCore 2.0 API for the myHouse platform
- Create a local database using
.\BuildScripts\CreateNewDb.ps1
- Point the appsettings.Development.json to the database
- Run the MyHouseAPI.csproj (vsCode or vs F5)
- Get a valid firebase Token, run the integration tests (two firebase user tokens are provided there) or run the MyHouseClient app and login (https://github.com/Burtbox/MyHouseClient.git)
- Via localhost\swagger post API requests
You will need the following versions (or higher) of:
.NetCore 2.0 SDK
SQL Server 2016
SQL Server Management Studio 2016
Visual Studio Code (or Visual Stuido 2017)
Recommended Extensions for Visual Studio Code
C#
Powershell
.NetCore Test Runner
Create a local database with
.\BuildScripts\CreateNewDb.ps1
Set the appSettings.Development.json to use that database
Run the API
Go to localhost\swagger to view and use the endpoints
Visual Studio Code .NetCore Test runner (or Ctrl + R, Ctrl + T) - run tests Visual Studio Test Explorer - run tests cmd - run
dotnet test ./MyHouse_UnitTests/MyHouseUnitTests.csproj
These test End to End functionality and require live data
A test database already exists on EDLAPTOP, to update this:
- Run the update db script
.\BuildScripts\UpgradeDb.ps1
Locally create a new test db: (drops and creates)
- Run the setup command: (this creates a new integration test db on EDLAPTOP\EDLAPTOPSQL as MyHouse_Dev_Tests with the data setup in ./MyHouse_IntegrationTests/TestData)
.\BuildScripts\SetupUnitTestDb.ps1
Debug a specific test:
- switch testsettings.json to your local api (commented in file)
- Run the web api (F5)
- Debug a specific test (above the method name in vscode)
Deploy static test api: Stop app pool MyHouseTestAPI on edLaptop
dotnet publish ./MyHouse_API -c Release -o "\\edlaptop\wwwroot\MyHouseTestAPI"
Run all tests:
- switch testsettings.json to use test api on edpaptop (commented in file)
- Use .netTestExplorer plugin to run all tests
Not implemented
Integration Test API: 1. Stop the app pool MyHouseAPI on livingroompc 2. Run the command
```
dotnet publish ./MyHouse_API -c Release -o "C:\inetpub\wwwroot\MyHouseAPI\MyHouse_API\bin\Release\"
```
copy to living room pc
To contribute to this project create a pull request on github (https://github.com/Burtbox/MyHouseAPI.git)
We use git for versioning. For the versions available, see the tags on this repository.
- Ed Burt - Developer - (https://github.com/Burtbox)
- Chris Field - Developer - (https://github.com/chrisjfield)
See also the list of contributors who participated in this project.
This project is unlicensed
- The Access Group (https://www.theaccessgroup.com/)
- Microsoft (https://www.microsoft.com/en-gb/)