public void EventCartItemsTest() { var repo = new EventCartItemsRepository(GetMockContext().Object); var res = repo.EventCartItems; Assert.Equal(res.ToList <EventCartItem>().ToString(), TestCart.ToList <EventCartItem>().ToString()); }
public void RemoveItemTest() { var mock = GetMockContext(); var repo = new EventCartItemsRepository(mock.Object); repo.RemoveItem(1, "1"); Assert.NotNull(repo); }
public void GetAllItemsTest() { var mock = GetMockContext(); var repo = new EventCartItemsRepository(mock.Object); var result = repo.GetAllItems("1"); var expected = TestCart.Where(s => s.UserId == "1").ToList(); Assert.Equal(expected.ToString(), result.ToString()); }
public void ItemExistsTest() { var mock = GetMockContext(); var repo = new EventCartItemsRepository(mock.Object); Assert.NotNull(repo); var result = repo.ItemExists(1, "1"); Assert.True(result); result = repo.ItemExists(1, "2"); Assert.False(result); }