public void Login_CollectorDoesUserExistReturnsTrueAndGetFoodplanIdReturns5_UutFoodplanIdIs5() { _collector.DoesUserExist("", "").ReturnsForAnyArgs(true); _collector.GetFoodplanId("").ReturnsForAnyArgs(5); _uut.Login("Bent", "Secret"); Assert.That(_uut.FoodplanId, Is.EqualTo(5)); }
public void Update_LoginModelFoodplanIdIsLessThanZero_FoodplaCollectorNotCalled() { _userCollector.GetFoodplanId(Arg.Any <string>()).Returns(-1); _uut.Update(); _foodplanCollector.DidNotReceive().GetById(Arg.Any <int>()); }
/// <summary> /// Gets the IDs for the users shoppinglist and foodplan /// </summary> /// <param name="username">Username to get IDs for</param> private async void GetUserInfo(string username) { ShoppinglistId = await _collector.GetShoppinglistId(username); FoodplanId = await _collector.GetFoodplanId(username); }