public async void SetMeritOrder_HappyFlow() { //Arrange var powerplants = PowerplantFixture.GetPowerplantModels(); var fuels = PowerplantFixture.BuildFuels(); var sut = new MeritOrderService(); //Act var actualResults = await sut.SetMeritOrder(powerplants, fuels); //Assert foreach (var actualResult in actualResults) { Assert.NotEqual(0, actualResult.MeritOrder); output.WriteLine($"{actualResult.Name} : {actualResult.MeritOrder} position"); Assert.Equal(PowerplantFixture.ExpectedResult() .Where(x => x.Name == actualResult.Name) .Select(x => x.MeritOrder).SingleOrDefault(), actualResult.MeritOrder); } }
public async void CalculateUnitOfCommitment_HappyFlow() { //Arrange var powerplants = PowerplantFixture.GetPowerplantModels(); var fuels = PowerplantFixture.BuildFuels(); var load = 480; var sut = MakeSut(powerplants, fuels); //Act var actualResults = await sut.CalculateUnitOfCommitment(powerplants, load, fuels); //Assert Assert.Equal(load, actualResults.Sum(x => x.P)); foreach (var actualResult in actualResults) { output.WriteLine($"{actualResult.Name} : {actualResult.P} power"); Assert.Equal(PowerplantFixture.ExpectedResult() .Where(x => x.Name == actualResult.Name) .Select(x => x.P).SingleOrDefault(), actualResult.P); } }