Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
380 commits
Select commit Hold shift + click to select a range
f1f01b8
Test null id for confirmation code service
tbeswick96 Feb 11, 2020
fadd7d9
Changed data property to use base method for data services. Added tes…
tbeswick96 Feb 17, 2020
0e64ded
Added further tests cases for confirmation code service
tbeswick96 Feb 17, 2020
5bdd564
Some cleanup, further tests. Changed scheduled jobs to use two differ…
tbeswick96 Feb 17, 2020
c8ffba4
Further tests. Changed some data tests to only test the concerns of t…
tbeswick96 Feb 21, 2020
33c8623
Remove unused methods in fake notification data service
tbeswick96 Feb 21, 2020
fc9cc5a
Added further testing. Restore collection name to former at end of ad…
tbeswick96 Feb 22, 2020
172c9d0
Refactored data collection to use a simple factory method. This makes…
tbeswick96 Feb 23, 2020
a4cb292
Cleanup rider warnings
tbeswick96 Feb 23, 2020
82a5b99
Improved data cache class handling. Removed use of dynamic to use cac…
tbeswick96 Feb 24, 2020
997fe44
Add integration tests for datacollection. Added test data files Furth…
tbeswick96 Feb 25, 2020
d2a36a2
Combine test projects into one, as coverlets doesn't properly work wi…
tbeswick96 Feb 25, 2020
f15af92
Made data integration tests faster
tbeswick96 Feb 26, 2020
ebec0ec
Force build
tbeswick96 Feb 27, 2020
3d8f053
Disable mongo2go logging
tbeswick96 Feb 27, 2020
0cd6821
Use separate build step
tbeswick96 Feb 27, 2020
8669cab
Revert test build
tbeswick96 Feb 27, 2020
de6e9e6
Add a small delay before finishing test after disposing test database
tbeswick96 Feb 27, 2020
7d8a819
Try using IDisposable
tbeswick96 Feb 27, 2020
3baf2d1
Try using a different database name for each run
tbeswick96 Feb 27, 2020
10f1d48
Try adding test data synchronously
tbeswick96 Feb 27, 2020
f17ae9e
Change scheduled actions to use a proper service where actions are re…
tbeswick96 Mar 7, 2020
def99fc
Changed integration startup structure
tbeswick96 May 23, 2020
18498dc
Merge pull request #3 from uksf/unit-tests
tbeswick96 May 23, 2020
ed75e64
Update README.md
tbeswick96 May 23, 2020
678d2a6
Update README.md
tbeswick96 May 23, 2020
d27daa5
Remove type from scheduled job model
tbeswick96 May 23, 2020
94e6f04
Removed unused Task extension method
tbeswick96 May 23, 2020
a6981f8
Use integrations load for scheduler service
tbeswick96 May 24, 2020
2d2e498
Use correct data instance for integrations scheduled jobs
tbeswick96 May 24, 2020
2027362
Remove Integrations
tbeswick96 May 25, 2020
06dd205
Use API URL for connection redirect
tbeswick96 May 25, 2020
381a7d7
More unit tests
tbeswick96 May 28, 2020
a7b1963
Fixed up a few tests, use different method for merging teamspeak grou…
tbeswick96 May 29, 2020
352c76e
Removed unused asynclock class
tbeswick96 May 29, 2020
44c8d70
Fixed units order using predicate, fixed member order in command requ…
tbeswick96 May 29, 2020
96fceac
Tweaks, discord nickname for application data
tbeswick96 May 30, 2020
d77e585
Remove no longer valid tests
tbeswick96 May 30, 2020
edf7b90
More unit tests
tbeswick96 May 30, 2020
9278cc8
Covered some missing test branches
tbeswick96 May 30, 2020
6c6ef05
Cover extra branches in teamspeak event handler tests
tbeswick96 May 30, 2020
cb22411
Experimentation with controller validation
tbeswick96 May 31, 2020
445c270
Few more tests
tbeswick96 Jun 4, 2020
25edeb0
Update to use variables for unit lookups
tbeswick96 Jun 9, 2020
d9f4b87
Fixes to chain of command service
tbeswick96 Jun 9, 2020
2201eef
Changes to accounts and confirmation codes
tbeswick96 Jun 12, 2020
07e0067
A lesson in annoying people
tbeswick96 Jun 17, 2020
2bc5f4f
Changes for update role preferences
tbeswick96 Jun 21, 2020
9b711c4
Added instagram image controller
tbeswick96 Jun 27, 2020
9297bb1
Logging for insta service
tbeswick96 Jun 27, 2020
feaabc2
Instagram Logging
tbeswick96 Jun 27, 2020
44cc23b
Wrap instagram in try
tbeswick96 Jun 27, 2020
aac74ab
Log insta response
tbeswick96 Jun 27, 2020
7b32b21
Change to use instagram API
tbeswick96 Jun 27, 2020
8865cfb
Remove extra log in instagram image get
tbeswick96 Jun 27, 2020
4012af9
First work towards modpack builds
tbeswick96 Jul 1, 2020
8874c91
Further additions for building
tbeswick96 Jul 6, 2020
3caffa1
Reworked builds to split into dev and release candidate builds
tbeswick96 Jul 7, 2020
1f02d8b
Added new build functionality. Moved steps to own service
tbeswick96 Jul 9, 2020
9c5c9e6
Order instagram images by date before checking for new ones
tbeswick96 Jul 10, 2020
e016204
Run insta action at startup
tbeswick96 Jul 10, 2020
c27b40e
Added mac and eliason as team medics
tbeswick96 Jul 11, 2020
ac17034
Few tweaks
tbeswick96 Jul 15, 2020
682bbf6
Build notifications and build tweaks
tbeswick96 Jul 18, 2020
3e9710f
Extracted methods from modpack controller to service
tbeswick96 Jul 18, 2020
a9cff4b
Moved github push methods to modpack service. Added changelog regener…
tbeswick96 Jul 18, 2020
8d4dbb6
Removed notification setting, changed dev/rc notification to discord …
tbeswick96 Jul 20, 2020
d870a45
Tweaks
tbeswick96 Jul 23, 2020
313f276
Edited servers to use modpack environments
tbeswick96 Jul 23, 2020
d110d6d
Use game service in build queue
tbeswick96 Jul 23, 2020
797e36a
Changed servers to use environment installations
tbeswick96 Jul 24, 2020
02622ec
Update cert path
tbeswick96 Jul 24, 2020
62395ab
Merge branch 'master' of github.com:uksf/api into 175-modpack-builds
tbeswick96 Jul 24, 2020
a647311
Lots of fixes, added several build steps, changed game servers to use…
tbeswick96 Jul 25, 2020
46dcacd
Added woodward as engineer
tbeswick96 Jul 25, 2020
a84cf21
Tweaks and bug fixes
tbeswick96 Jul 26, 2020
8315a42
Added intercept move and sign steps
tbeswick96 Jul 27, 2020
314db1d
Added sources step. Added support for build environment variables.
tbeswick96 Jul 27, 2020
ba49f54
Added mod build steps. Further tweaks and fixes
tbeswick96 Jul 29, 2020
42667ae
Large tweaks and fixes
tbeswick96 Aug 1, 2020
0e25fee
Added static mod rebuild conditions
tbeswick96 Aug 2, 2020
15fc385
Temporary channel ids for discord build notifs
tbeswick96 Aug 2, 2020
9254ee4
Merge branch '175-modpack-builds'
tbeswick96 Aug 2, 2020
7bf2d2c
Check if previous build exists before trying to pull env vars
tbeswick96 Aug 2, 2020
49fd8ee
Add subst print for prep plus logging
tbeswick96 Aug 2, 2020
f0d174b
Fix quotes in prep. Fix min version for branch. Add warning if proces…
tbeswick96 Aug 2, 2020
3d28c90
Handle extra data being flushed to output by make in json string
tbeswick96 Aug 2, 2020
2c91492
Fixes to build process
tbeswick96 Aug 2, 2020
42e6ee9
Add error exclusions
tbeswick96 Aug 2, 2020
06cbc47
Ignore errors between makepbo calls, increase update delay for mod st…
tbeswick96 Aug 2, 2020
667221f
Increase build timeouts
tbeswick96 Aug 2, 2020
444467c
Fix build notification message environment
tbeswick96 Aug 2, 2020
1b1ed45
Put release notification description in code block
tbeswick96 Aug 2, 2020
029ec8c
Try synchronous dependencies sign
tbeswick96 Aug 2, 2020
ac72492
Convert build process helper to more manageable object. Only clean ne…
tbeswick96 Aug 3, 2020
2eaf390
Remove unused async from build process helper
tbeswick96 Aug 3, 2020
4a60971
Set build notification channel ids to live channels. Remove TODO for …
tbeswick96 Aug 3, 2020
575e67d
Change reset server mods to only return the default mods for that server
tbeswick96 Aug 3, 2020
293142d
Remove pointless process kill
tbeswick96 Aug 3, 2020
61ff405
Make release backup more granular to speed it up
tbeswick96 Aug 3, 2020
9c64e1e
Fix old audit log format usage
tbeswick96 Aug 4, 2020
ae39f3c
Only push step update if the step has changed
tbeswick96 Aug 4, 2020
27e033f
Filter commit messages
tbeswick96 Aug 5, 2020
bcf7649
Skip commit message string steps
tbeswick96 Aug 5, 2020
fd16a53
Remove ref/heads from branch name when checking out
tbeswick96 Aug 5, 2020
151a7fa
Re-enable notify step
tbeswick96 Aug 5, 2020
f243b4e
Replace git fetch in sources commands
tbeswick96 Aug 5, 2020
cbac579
Append signature and issues link to changelog
tbeswick96 Aug 5, 2020
b7dfbca
Change engineer and medic slots to use a variable of ids
tbeswick96 Aug 10, 2020
d997136
Fix teamspeak event test
tbeswick96 Aug 10, 2020
2c8cfec
Change grant type for instagram token
tbeswick96 Aug 11, 2020
85fa361
Don't notify for dev builds, only rc
tbeswick96 Aug 12, 2020
76d5ee3
Remove notify step from dev builds
tbeswick96 Aug 12, 2020
98a18e8
Turn on logging for sources step
tbeswick96 Aug 13, 2020
8c32670
Don't raise errors for sources
tbeswick96 Aug 13, 2020
6a2a438
Split git checkout and pull for modpack source
tbeswick96 Aug 13, 2020
38f93dd
Remove debug reference name, don't error process if cancelled. Split …
tbeswick96 Aug 13, 2020
b8b0c5e
Fix empty process return
tbeswick96 Aug 13, 2020
03d593e
Change mod build steps to always move latest release files to build
tbeswick96 Aug 13, 2020
193b78a
Don't only search for closed issues when generating changelog
tbeswick96 Aug 13, 2020
318d051
Show output for git commands
tbeswick96 Aug 14, 2020
879c617
Try without fetch
tbeswick96 Aug 14, 2020
aac8256
Checkout remote branch then local to ensure branch is local and check…
tbeswick96 Aug 14, 2020
4a14ace
Re-enable rc notify step
tbeswick96 Aug 14, 2020
efad719
Changed build cancel to remove from queue if build has not started. P…
tbeswick96 Aug 14, 2020
16c5523
Mark build cancelled in queue as cancelled
tbeswick96 Aug 14, 2020
b3209b9
Remove repo backup clean step, merge release into master instead of d…
tbeswick96 Aug 14, 2020
d85a2b0
Add newlines when none exist at end of changelog
tbeswick96 Aug 15, 2020
073f8c6
Better line breaks for changelog end
tbeswick96 Aug 15, 2020
213f68f
Use different method to merge release into master
tbeswick96 Aug 15, 2020
9afdabd
Fix github reference validation against version
tbeswick96 Aug 18, 2020
e24f7cd
Add extra merge commands for release step
tbeswick96 Aug 20, 2020
4d41eb1
Replace <br> with \n for github release changelog
tbeswick96 Aug 20, 2020
031dbb7
Filter release commit message from previous release merge out of chan…
tbeswick96 Aug 22, 2020
70682d3
Set account as rifleman when going from recruit to private
tbeswick96 Aug 27, 2020
da14d7e
Simplify instagram image caching slightly
tbeswick96 Aug 28, 2020
8dae0ec
Remove predicate condition for new instagram images
tbeswick96 Aug 28, 2020
2fdbe92
Wrap server mod args in quotes
tbeswick96 Aug 30, 2020
047c2b8
Check for no servers more frequently for build queue
tbeswick96 Sep 18, 2020
50884de
Add some logging to release, use batching for signing
tbeswick96 Sep 18, 2020
7d77266
Make master branch the normal branch for dev builds
tbeswick96 Sep 22, 2020
7b1c156
Remove unneeded log from dependencies signing step
tbeswick96 Sep 22, 2020
36ec360
Instagram tweaks, login/application flow tweaks
tbeswick96 Sep 26, 2020
cde2623
.net 5, cleanup, tests, perf improvments
tbeswick96 Oct 7, 2020
25f80c2
Update test.yml
tbeswick96 Oct 7, 2020
05a5491
.net 5, cleanup, tests, perf improvments
tbeswick96 Oct 17, 2020
bd075ef
Fix tests and rank order null
tbeswick96 Oct 17, 2020
d756465
Fix issues in teamspeak group service
tbeswick96 Oct 19, 2020
7eb9f75
Fix unit root first child tags being removed when also in elcom
tbeswick96 Oct 19, 2020
46f4163
Fix bug in teamspeak groups
tbeswick96 Oct 19, 2020
329dc94
Update group assignments on unit parent change
tbeswick96 Oct 19, 2020
9436518
Fix groups for candidate
tbeswick96 Oct 20, 2020
214babc
Stashing
tbeswick96 Oct 21, 2020
bfebe90
Fix contextId null during password reset
tbeswick96 Oct 21, 2020
cff7956
Resolve UKSF into JSFAW
tbeswick96 Oct 24, 2020
8e7b779
Further refactor work
tbeswick96 Oct 26, 2020
33a3ea7
Edit discord release notification
tbeswick96 Oct 29, 2020
88014f9
Merge branch 'master' into project-refactor
tbeswick96 Oct 29, 2020
ccb10bc
Progress on refactor
tbeswick96 Nov 1, 2020
d8a4918
More progress
tbeswick96 Nov 8, 2020
f148f88
Move signlar hub creation to components
tbeswick96 Nov 8, 2020
55ff244
Nearly there
tbeswick96 Nov 8, 2020
9105421
All errors and tests fixed
tbeswick96 Nov 15, 2020
0c2851a
Large refactor, rename data services to contexts
tbeswick96 Nov 21, 2020
f605280
Add dependency injection tests
tbeswick96 Nov 22, 2020
b110ef1
Changed event bus to use a single bus with typed data
tbeswick96 Dec 5, 2020
7865662
Fixes and tweaks
tbeswick96 Dec 12, 2020
333562b
Fixes and tweaks
tbeswick96 Dec 13, 2020
4ff11be
Remove discord debug message. Reset migration
tbeswick96 Dec 13, 2020
ab18e2e
Update test.yml
tbeswick96 Dec 13, 2020
a6c35d3
Fix emotes
tbeswick96 Dec 13, 2020
34d9dee
Merge branch 'master' of github.com:uksf/api
tbeswick96 Dec 13, 2020
b95654b
Fix modpack build prune deleting RC builds
tbeswick96 Dec 13, 2020
998fa3a
Add discord weekly announcement reaction handling
tbeswick96 Dec 14, 2020
aa60cf5
Fixed change detection for types without fields
tbeswick96 Dec 17, 2020
9942d10
Simplify server mods update
tbeswick96 Dec 18, 2020
0ec20b0
Add timestamp to discord left comment
tbeswick96 Dec 20, 2020
ea26a4e
Skip left discord comment if discharged or unconfirmed account
tbeswick96 Dec 23, 2020
ac30b1f
Fix build processing error handling, and build step service scope
tbeswick96 Dec 23, 2020
78f5c08
Update mission patching data resolvers for new jsfaw structure
tbeswick96 Dec 27, 2020
f34d6ee
Add instagram token job reset
tbeswick96 Jan 10, 2021
2761282
Add additional logging to debug discord left event not posting applic…
tbeswick96 Jan 31, 2021
3ea9e5a
Don't skip source update if forced
tbeswick96 Feb 21, 2021
7450187
Don't log build restore attempt if not release
tbeswick96 Feb 21, 2021
7aaff35
Disable arma server logging object not found spam
tbeswick96 Feb 23, 2021
f0a3074
Restore previous regularCheck setting
tbeswick96 Feb 26, 2021
7cb54ea
Added more reserve slots
tbeswick96 Mar 1, 2021
cde8adb
Up max troop size to 12
tbeswick96 Mar 1, 2021
66bed0a
Change F-35 to Air
tbeswick96 Mar 28, 2021
2200c11
Release UKSF Air as its own mod
tbeswick96 Mar 28, 2021
1937541
Fix air build path
tbeswick96 Mar 28, 2021
ed19450
Add allow glasses false to description verification
tbeswick96 Apr 27, 2021
db38dfd
Disable modpack build block when servers are running
tbeswick96 May 12, 2021
c3eb980
Support creator dlc mod paths in server mods search
tbeswick96 May 14, 2021
a36c71d
Use regex
tbeswick96 May 14, 2021
e4a476f
Implement exception handling middleware for consistent error responses
tbeswick96 May 15, 2021
7636f28
Allow duplicate player connections
tbeswick96 May 15, 2021
7690cd6
Allow duplicate steam player
tbeswick96 May 15, 2021
e000ed5
Revert
tbeswick96 May 15, 2021
76555b8
Merge branch 'master' into erro_handling
tbeswick96 May 16, 2021
1c4172e
Fix server config
tbeswick96 May 15, 2021
91ae5a5
Add common exception handling, return concrete types as preference
tbeswick96 May 24, 2021
176c0df
Cleanup
tbeswick96 May 24, 2021
e842778
Remove path reference
tbeswick96 May 24, 2021
d8fb177
Try endpoint routing
tbeswick96 May 24, 2021
535818b
Use controllerbase
tbeswick96 May 24, 2021
619f17c
Make tests appsettings distinct
tbeswick96 May 24, 2021
c0ce710
Return correct status code for login failure
tbeswick96 May 24, 2021
69c0036
Premail email templates
tbeswick96 May 24, 2021
2492e44
2nd pass premailer
tbeswick96 May 24, 2021
ba51274
Fix mission condition when checking if notifs are disabled
tbeswick96 May 24, 2021
b250299
Set up CI with Azure Pipelines
tbeswick96 May 24, 2021
71eef8e
Merge pull request #4 from uksf/azure-pipelines
tbeswick96 May 24, 2021
3591ed5
Update build.yml for Azure Pipelines
tbeswick96 May 24, 2021
13853bb
Update build.yml for Azure Pipelines
tbeswick96 May 24, 2021
a653bf9
Make dates locale-agnostic
tbeswick96 May 26, 2021
475efdf
Adapt for environment-agnostic release
tbeswick96 May 26, 2021
f82e28e
Determine run as service from app setting
tbeswick96 May 26, 2021
50d7522
Update build.yml for Azure Pipelines
tbeswick96 May 27, 2021
8828088
Update build.yml for Azure Pipelines
tbeswick96 May 27, 2021
67f3f39
Update build.yml for Azure Pipelines
tbeswick96 May 27, 2021
a6cd300
Update build.yml for Azure Pipelines
tbeswick96 May 27, 2021
0957ffd
Update build.yml for Azure Pipelines
tbeswick96 May 27, 2021
a1a171b
Use correct path for logs
tbeswick96 May 27, 2021
24be884
Add json config to startup
tbeswick96 May 27, 2021
4a4c80b
Some logging
tbeswick96 May 27, 2021
b22347c
Remove specific appsettings load
tbeswick96 May 27, 2021
de62ac8
Try changing path for program appsettings read
tbeswick96 May 27, 2021
e97cbf5
Remove pdb output for debug
tbeswick96 May 27, 2021
1071a8e
Change version update to not need a body
tbeswick96 May 27, 2021
f541aa4
Base64 encode github app token
tbeswick96 Jun 3, 2021
032c72c
Emit servers updates, form accounts return, fix comment thread link
tbeswick96 Jun 10, 2021
130b227
Remove timeout from get server
tbeswick96 Jun 26, 2021
b90a79e
Move optionals for acre
tbeswick96 Jul 13, 2021
cdc2dea
Always force build mods if first RC build
tbeswick96 Jul 13, 2021
1b783f2
Add test, move logic for rc force
tbeswick96 Jul 13, 2021
be9eb4d
Fix bad name for air variable
tbeswick96 Jul 13, 2021
86cd60f
Don't move acre optionals, requires the dlc
tbeswick96 Jul 13, 2021
bc5922b
Search all directories for mods
tbeswick96 Jul 13, 2021
af67fb1
Upgrade packages
tbeswick96 Jul 18, 2021
eed5716
Remove dotnetcore dev nuget source
tbeswick96 Jul 18, 2021
02d7034
Undo forcing rebuild on first RC build
tbeswick96 Jul 19, 2021
a9d9108
Remove now invalid test
tbeswick96 Jul 19, 2021
d5b88e9
Added paged queries for members list support
tbeswick96 Aug 7, 2021
d9b619c
Fix test
tbeswick96 Aug 7, 2021
d65d88c
Restroe null check when setting variables
tbeswick96 Aug 10, 2021
86c9315
Update days for candidate ops
tbeswick96 Aug 21, 2021
056ad71
Remove coverlet nightly nuget feed
tbeswick96 Aug 22, 2021
c5de22c
Add index to nuget feed
tbeswick96 Aug 22, 2021
a981245
Bump Microsoft.AspNetCore.Authentication.JwtBearer in /UKSF.Api.Auth
dependabot[bot] Aug 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# EditorConfig

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.json]
indent_size = 4
indent_style = space

[*.{markdown,md}]
indent_size = 4
indent_style = space
trim_trailing_whitespace = false

[*.xml]
indent_size = 4
indent_style = space

[*.{yaml,yml}]
indent_size = 2
indent_style = space
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build & Run Tests
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1

on:
push:
branches:
- master
pull_request:

jobs:
Test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: 5.x
- name: Build with dotnet
run: dotnet build -c Release
- name: Run tests with coverage
run: dotnet test ./UKSF.Api.sln -c Release --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=../coverage/lcov.info /p:Exclude="[UKSF.PostMessage]*"
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ _Pvt_Extensions

# Sensitive configs
**/appconfig/**
/UKSFWebsite.Api/website-backend-config/**
**/build_output/**
**/build_tests/**
**/__pycache__/**
Expand Down Expand Up @@ -260,5 +259,5 @@ coverage.xml
.idea/

# Specific
!UKSFWebsite.Api.Services/Debug**
appsettings.Development.json
*.info
28 changes: 0 additions & 28 deletions .vscode/launch.json

This file was deleted.

15 changes: 0 additions & 15 deletions .vscode/tasks.json

This file was deleted.

3 changes: 1 addition & 2 deletions NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/" />
<add key="dotnetpreview" value="https://dotnet.myget.org/F/aspnetcore-dev/api/" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# UKSF Website Backend

[![Coverage Status](https://coveralls.io/repos/github/uksf/api/badge.svg?branch=master)](https://coveralls.io/github/uksf/api?branch=master)
7 changes: 7 additions & 0 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

</Project>
49 changes: 49 additions & 0 deletions Tests/UKSF.Api.Admin.Tests/DependencyInjectionTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using UKSF.Api.Admin.Controllers;
using UKSF.Api.Admin.EventHandlers;
using UKSF.Api.Admin.ScheduledActions;
using UKSF.Api.Tests.Common;
using Xunit;

namespace UKSF.Api.Admin.Tests
{
public class DependencyInjectionTests : DependencyInjectionTestsBase
{
public DependencyInjectionTests()
{
Services.AddUksfAdmin();
}

[Fact]
public void When_resolving_controllers()
{
Services.AddTransient<DataController>();
Services.AddTransient<VariablesController>();
Services.AddTransient<VersionController>();
ServiceProvider serviceProvider = Services.BuildServiceProvider();

serviceProvider.GetRequiredService<DataController>().Should().NotBeNull();
serviceProvider.GetRequiredService<VariablesController>().Should().NotBeNull();
serviceProvider.GetRequiredService<VersionController>().Should().NotBeNull();
}

[Fact]
public void When_resolving_event_handlers()
{
Services.AddTransient<LogDataEventHandler>();
ServiceProvider serviceProvider = Services.BuildServiceProvider();

serviceProvider.GetRequiredService<LogDataEventHandler>().Should().NotBeNull();
}

[Fact]
public void When_resolving_scheduled_actions()
{
Services.AddTransient<ActionPruneLogs>();
ServiceProvider serviceProvider = Services.BuildServiceProvider();

serviceProvider.GetRequiredService<ActionPruneLogs>().Should().NotBeNull();
}
}
}
28 changes: 28 additions & 0 deletions Tests/UKSF.Api.Admin.Tests/UKSF.Api.Admin.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.0.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0"/>
<PackageReference Include="xunit" Version="2.4.1"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\UKSF.Api.Admin\UKSF.Api.Admin.csproj" />
<ProjectReference Include="..\UKSF.Api.Tests.Common\UKSF.Api.Tests.Common.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0"/>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>
31 changes: 31 additions & 0 deletions Tests/UKSF.Api.ArmaServer.Tests/DependencyInjectionTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using UKSF.Api.Admin;
using UKSF.Api.ArmaMissions;
using UKSF.Api.ArmaServer.Controllers;
using UKSF.Api.Personnel;
using UKSF.Api.Tests.Common;
using Xunit;

namespace UKSF.Api.ArmaServer.Tests
{
public class DependencyInjectionTests : DependencyInjectionTestsBase
{
public DependencyInjectionTests()
{
Services.AddUksfAdmin();
Services.AddUksfPersonnel();
Services.AddUksfArmaMissions();
Services.AddUksfArmaServer();
}

[Fact]
public void When_resolving_controllers()
{
Services.AddTransient<GameServersController>();
ServiceProvider serviceProvider = Services.BuildServiceProvider();

serviceProvider.GetRequiredService<GameServersController>().Should().NotBeNull();
}
}
}
28 changes: 28 additions & 0 deletions Tests/UKSF.Api.ArmaServer.Tests/UKSF.Api.ArmaServer.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.0.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0"/>
<PackageReference Include="xunit" Version="2.4.1"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\UKSF.Api.ArmaServer\UKSF.Api.ArmaServer.csproj" />
<ProjectReference Include="..\UKSF.Api.Tests.Common\UKSF.Api.Tests.Common.csproj" />
</ItemGroup>

</Project>
Loading