public void SelectSingleOrDefaultWithNoValuesInRepo() { var repo = new MSSQLRepository <string>(); var value = repo.SingleOrDefault(s => true); Assert.IsNull(value); }
public void SelectSingleValueFailsFromRepository() { var repo = new MSSQLRepository <string>(); repo.Single(s => true); Assert.Fail("Single should throw exception, source data contains more than one entry."); }
public void GetAllSingleCharStringsFromRepository() { var repo = new MSSQLRepository <string>(); int count = repo.Where(s => s.Length == 1).Count(); Assert.AreEqual(1, count); }
public void SelectFirstValueFromSelectFromRepository() { var repo = new MSSQLRepository <string>(); var value = repo.Select(s => s).First(); Assert.AreEqual("", value); }
public void UsingCountOnRepo() { var repo = new MSSQLRepository <string>(); int totalCount = repo.Count(); int specificCount = repo.Count(s => s == ""); Assert.AreEqual(0, totalCount); Assert.AreEqual(1, specificCount); }
public void CreateRepositoryOfType() { var repo = new MSSQLRepository <string>(); Assert.IsNotNull(repo); }