public void GetByID_No_Data_Returns_Null() { var mock = RepositoryMocks.GetMockUserRepository(); var actual = mock.GetByID(1); Assert.IsNull(actual); }
public void Exists_Item_Is_Null_Returns_False() { var mock = RepositoryMocks.GetMockUserRepository(new List <User> { new User() }); Assert.IsFalse(mock.Exists(null)); }
public void Get_Nothing_In_Database_Returns_Empty_List() { var mock = RepositoryMocks.GetMockUserRepository(); var all = mock.Get(); Assert.IsNotNull(all); Assert.AreEqual(0, all.Count()); }
public void Exists_Match_Found_Returns_True() { var mock = RepositoryMocks.GetMockUserRepository(new List <User> { new User { ID = 1 } }); Assert.IsTrue(mock.Exists(1)); }
public void GetByID_No_Match_Returns_Null() { var mock = RepositoryMocks.GetMockUserRepository(new List <User> { new User() }); var actual = mock.GetByID(1); Assert.IsNull(actual); }
public void Get_Returns_All_Data() { var expected = new List <User> { new User(), new User() }; var mock = RepositoryMocks.GetMockUserRepository(expected); var actual = mock.Get(); Assert.IsNotNull(actual); CollectionAssert.AreEquivalent(expected, actual.ToList()); }
public void Exists_Item_No_Match_Returns_False() { var mock = RepositoryMocks.GetMockUserRepository(new List <User> { new User { ID = 1 } }); Assert.IsFalse(mock.Exists(new User { ID = 2 })); }
public void GetByID_Returns_The_Item_With_The_Given_ID() { var expected = new User { ID = 1 }; var mock = RepositoryMocks.GetMockUserRepository(new List <User> { expected }); var actual = mock.GetByID(1); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); }
public void Exists_No_Match_Returns_False() { var mock = RepositoryMocks.GetMockUserRepository(); Assert.IsFalse(mock.Exists(1)); }