public void Can_CalculateProperValueIfFemaleHighActivity() { var userDto = new UserForUpdateDto { ActivityLevel = ActivityLevel.High }; var user = new UserDetails { User = new User { Weight = 60, Height = 160, Age = 40, Gender = "Female" } }; var mockUser = new Mock <IUserRepository>(); var mockDMRepo = new Mock <IDailyMealRepository>(); var _sut = new DCICalculator(mockUser.Object, mockDMRepo.Object); var result = _sut.CalculateDailyDemand(userDto, user); Assert.Equal(2830, result); }
public void Cannot_CalculateIdArgumentsAreNull() { UserForUpdateDto userDto = null; UserDetails user = null; var mockUser = new Mock <IUserRepository>(); var mockDMRepo = new Mock <IDailyMealRepository>(); var _sut = new DCICalculator(mockUser.Object, mockDMRepo.Object); Assert.Throws <ArgumentNullException>(() => _sut.CalculateDailyDemand(userDto, user)); }
//[Theory] //[InlineData(123, 50)] public void Can_CalculateCaloriesPerPortion(int mealId, int grams) { var mockUser = new Mock <IUserRepository>(); var mockDMRepo = new Mock <IDailyMealRepository>(); var _sut = new DCICalculator(mockUser.Object, mockDMRepo.Object); //var incomMeal = new Mock<IncomingRecipe>(); //var result = _sut.CalculateDailyDemand(userDto, user); //Assert.Equal(2830, result); }
public UserController(IUserRepository repo, IMapper mapper, DCICalculator calc) { _repo = repo; _mapper = mapper; _calc = calc; }
public DailyMealController(IDailyMealRepository repository, IMapper mapper, DCICalculator calc) { _repoUser = repository; _mapper = mapper; _calc = calc; }