Beispiel #1
0
        public void SelectSingleOrDefaultWithNoValuesInRepo()
        {
            var repo = new MSSQLRepository <string>();

            var value = repo.SingleOrDefault(s => true);

            Assert.IsNull(value);
        }
Beispiel #2
0
        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.");
        }
Beispiel #3
0
        public void GetAllSingleCharStringsFromRepository()
        {
            var repo = new MSSQLRepository <string>();

            int count = repo.Where(s => s.Length == 1).Count();

            Assert.AreEqual(1, count);
        }
Beispiel #4
0
        public void SelectFirstValueFromSelectFromRepository()
        {
            var repo = new MSSQLRepository <string>();

            var value = repo.Select(s => s).First();

            Assert.AreEqual("", value);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        public void CreateRepositoryOfType()
        {
            var repo = new MSSQLRepository <string>();

            Assert.IsNotNull(repo);
        }