-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEST-0006 Add more backend tests (#230)
<!--- Provide a general summary of your changes in the Title above --> ## Description 💬 <!--- Describe your changes in detail --> ## Motivation and Context 🥅 <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## How has this been tested? 🧪 <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, tests ran to see how --> <!--- your change affects other areas of the code, etc. --> - [x] Local build ⚒️ - [x] Local tests 🧪 - [ ] (optional) Local run and endpoint tested in swagger 🚀 ## Screenshots (if appropriate) 💻 ## Types of changes 🌊 <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## Checklist ☑️ <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] The pull request title starts with the jira case number (when applicable), e.g. "TEST-1234 Add some feature" - [x] The person responsible for following up on requested review changes has been assigned to the pull request - [x] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. ## Highly optional checks, only use these if you have a reason to do so ✔️ - [ ] This PR changes the database so I have added the *create-diagram* label to assist reviewers with a db diagram - [ ] This PR changes platform or backend and I need others to be able to test against these changes before merging to dev, so I have added the *deploy-azure* label to deploy before merging the PR ## Checklist for the approver ✅ - [ ] I've checked the files view for spelling issues, code quality warnings and similar - [ ] I've waited until all checks have passed (green check/without error) - [ ] I've checked that only the intended files are changed
- Loading branch information
Showing
31 changed files
with
1,118 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RunSettings> | ||
<DataCollectionRunSettings> | ||
<DataCollectors> | ||
<DataCollector friendlyName="XPlat code coverage"> | ||
<Configuration> | ||
<Format>cobertura</Format> | ||
<ExcludeByFile>"**/*Migrations/*.cs"</ExcludeByFile> | ||
</Configuration> | ||
</DataCollector> | ||
</DataCollectors> | ||
</DataCollectionRunSettings> | ||
</RunSettings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tests/backend/WebApi.Tests/Attributes/DefineConstantsAttributeTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using WebApi.Attributes; | ||
|
||
namespace WebApi.Tests.Attributes; | ||
|
||
[TestFixture] | ||
public class DefineConstantsAttributeTests | ||
{ | ||
[Test] | ||
public void AttributeInstantiation_WithConstantsString_IsNotNull() | ||
{ | ||
// Arrange | ||
const string constantsString = "\"CONST1;CONST2;CONST3\""; | ||
|
||
// Act | ||
var attribute = new DefineConstantsAttribute(constantsString); | ||
|
||
// Assert | ||
Assert.That(attribute, Is.Not.Null); | ||
} | ||
|
||
[Test] | ||
public void ConstantsProperty_WithValidConstantsString_ParsesCorrectly() | ||
{ | ||
// Arrange | ||
const string constantsString = "\"CONST1;CONST2;CONST3\""; | ||
var expectedConstants = new[] | ||
{ | ||
"CONST1", "CONST2", "CONST3" | ||
}; | ||
|
||
var attribute = new DefineConstantsAttribute(constantsString); | ||
|
||
// Act | ||
var actualConstants = attribute.Constants; | ||
|
||
// Assert | ||
Assert.That(expectedConstants, Is.EqualTo(actualConstants)); | ||
} | ||
} |
Oops, something went wrong.