public void Calculate_InvalidStarshipConsumables_ReturnUnknown() { //Arrange var userInput = 1000000; var starship = fixture.Build <Starship>() .With(property => property.Mglt, fixture.Create <int>().ToString()) .Create(); //Act var result = resupplyCalculatorService.Calculate(userInput, starship); //Assert result.Should().NotBeNull(); result.Should().Be(ResupplyConstants.Unknown); }
/// <summary> /// Calculates the specified megalights for a given starship. /// </summary> /// <param name="megalights">The megalights.</param> /// <param name="starship">The starship.</param> /// <returns>A <see cref="string"/> object.</returns> public string Calculate(decimal megalights, Starship starship) { return(resupplyCalculatorService.Calculate(megalights, new Domain.Model.Starship.Starship { Consumables = starship.Consumables, Mglt = starship.Mglt })); }
public void Calculate_CallsService_ReturnValue() { //Arrange var resultService = fixture.Create <string>(); var megalights = fixture.Create <decimal>(); var starship = fixture.Create <StarshipResupply.Application.Dto.Starship.Starship>(); resupplyCalculatorService.Calculate(Arg.Any <decimal>(), Arg.Any <Starship>()).Returns(resultService); //Act var result = resupplyService.Calculate(megalights, starship); //Assert result.Should().Be(resultService); resupplyCalculatorService.Received(1).Calculate(Arg.Any <decimal>(), Arg.Any <Starship>()); }