コード例 #1
0
        public void GetCityById_ShouldFindCity()
        {
            // Arrange
            CitySqlDAO dao = new CitySqlDAO(connectionString);

            // Act - Call GetCity..passing the id that was added during our test setup.
            City city;

            city = dao.GetCityById(this.newCityId);

            // Assert - We found Smallville
            Assert.IsNotNull(city);
            Assert.AreEqual("Smallville", city.Name);
        }
コード例 #2
0
        public void GetCityById_ShouldFindCity()
        {
            // Arrange
            CitySqlDAO dao = new CitySqlDAO(connectionString);

            // Act


            // TODO: We need to get a valid city Id from our script
            // Uh-oh...how do I know what city ids exist in the db?
            City city;

            city = dao.GetCityById(0);

            // Assert - We found Smallville
            Assert.IsNotNull(city);
            Assert.AreEqual("Smallville", city.Name);
        }