1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

Feature/bit auto data (#2219)

* Update ProviderService tests

* Use BitAutoData in CipherService tests

* Simplify UserCipher fixture

Because we use a single customizer for all ciphers, they all have the same userId.

* Clean up more cipher fixtures

* Swap Cipher Fixtures to BitCustomizeAttribute

* Clean up collection fixtures

* Clean up GroupFixtures

* Move SendService Tests to BitAutoData

* Clean up Organization Fixtures

TODO: The customize attributes should not be customizing more than one class

* Name files after the class they contain

* Clear up usage of CustomAutoDataAttribute in tests

* Clean up usages of InlineCustomAutoData

* format

* Manually merge with file-scoped-namespace changes
This commit is contained in:
Matt Gibson
2022-08-31 07:38:35 -06:00
committed by GitHub
parent 2d9d6ad812
commit a6d97118fa
28 changed files with 423 additions and 484 deletions

View File

@ -286,7 +286,7 @@ public class CoreHelpersTests
Assert.Equal("Contents of embeddedResource.txt\n", fileContents.Replace("\r\n", "\n"));
}
[Theory, CustomAutoData(typeof(UserFixture))]
[Theory, BitAutoData, UserCustomize]
public void BuildIdentityClaims_BaseClaims_Success(User user, bool isPremium)
{
var expected = new Dictionary<string, string>
@ -308,7 +308,7 @@ public class CoreHelpersTests
Assert.Equal(expected.Count, actual.Count);
}
[Theory, CustomAutoData(typeof(UserFixture))]
[Theory, BitAutoData, UserCustomize]
public void BuildIdentityClaims_NonCustomOrganizationUserType_Success(User user)
{
var fixture = new Fixture().WithAutoNSubstitutions();
@ -324,7 +324,7 @@ public class CoreHelpersTests
}
}
[Theory, CustomAutoData(typeof(UserFixture))]
[Theory, BitAutoData, UserCustomize]
public void BuildIdentityClaims_CustomOrganizationUserClaims_Success(User user, CurrentContentOrganization org)
{
var fixture = new Fixture().WithAutoNSubstitutions();
@ -346,7 +346,7 @@ public class CoreHelpersTests
}
}
[Theory, CustomAutoData(typeof(UserFixture))]
[Theory, BitAutoData, UserCustomize]
public void BuildIdentityClaims_ProviderClaims_Success(User user)
{
var fixture = new Fixture().WithAutoNSubstitutions();