Created
March 12, 2020 12:32
-
-
Save dzas/69f311a4e07ef32bffc6dd4a4d45df0a to your computer and use it in GitHub Desktop.
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
[Fact] | |
public async Task GetKktInfoByGroupCodeAsync_ShouldBeReturnKktWithRequestedGroupCode() | |
{ | |
//arrange | |
var source = DataGenerator.CreateRandomizedObjectSet(); | |
var expectedKktCount = source.TargetGroup.Kkts.Count(x => !x.Deleted); | |
var expectedGroupCode = source.TargetGroup.GroupCode; | |
DataGenerator.SaveCompanies(source.Companies, _contextFixture.AtolMainDbConnectionString); | |
DataGenerator.SaveMonitoringEvents(source.MonitoringEvents, _contextFixture.MonitoringDbConnectionString); | |
KktInfoRepository sut = new KktInfoRepository(_contextFixture.AtolMainDbContext, | |
_contextFixture.MonitoringDbContext); | |
//act | |
var actualKkts = new List<KktInfo>(); | |
await sut.GetKktInfoByGroupCodeAsync(source.TargetClientId, source.TargetGroup.GroupCode) | |
.ForEachAsync(items => actualKkts.AddRange(items)); | |
//assert | |
Assert.Equal(expectedKktCount, actualKkts.Count); | |
Assert.All(actualKkts, actualKkt => Assert.Equal(expectedGroupCode, actualKkt.GroupCode)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment