Esempio n. 1
0
        public void SelectSingleOrDefaultWithNoValuesInRepo()
        {
            var repo = new MSSQLRepository <string>();

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

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

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

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

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

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

            Assert.IsNotNull(repo);
        }