Beispiel #1
0
        public void WebsiteCategoryRepository_GetLargestId()
        {
            //Arrange
            Database.Add(new WebsiteCategories()
            {
                Id = 32, Agency = "fcc.gov"
            });
            Database.Add(new WebsiteCategories()
            {
                Id = 65, Agency = "usa.gov"
            });
            Database.Add(new WebsiteCategories()
            {
                Id = 12, Agency = "epa.gov"
            });
            Database.SaveChanges();

            var repository = new WebsiteCategoryRepository(new DatabaseFactory(Database));

            //Act
            var maxId = repository.GetLargestId();

            //Assert
            Assert.AreEqual(65, maxId);
        }
Beispiel #2
0
        public void WebsiteCategoryRepository_GetLargestId_NoCategories()
        {
            //Arrange
            var repository = new WebsiteCategoryRepository(new DatabaseFactory(Database));

            //Act
            var maxId = repository.GetLargestId();

            //Assert
            Assert.AreEqual(0, maxId);
        }