Beispiel #1
0
        public void Constructor_ShouldInitializeCitiesCollection()
        {
            //Arrange && Act
            var country = new Models.Locations.Country();

            //Assert
            Assert.That(country.Cities, Is.Not.Null.And.InstanceOf <ICollection <Models.Locations.City> >());
        }
Beispiel #2
0
        public void Name_ShouldBeSetAndGottenCorrectly(string testName)
        {
            //Arrange && Act
            var country = new Models.Locations.Country {
                Name = testName
            };

            //Assert
            Assert.AreEqual(testName, country.Name);
        }
Beispiel #3
0
        public void Id_ShouldBeSetAndGottenCorrectly(string testId)
        {
            //Arrange && Act
            var country = new Models.Locations.Country {
                Id = Guid.Parse(testId)
            };

            //Assert
            Assert.AreEqual(testId, country.Id.ToString());
        }
Beispiel #4
0
        public void Country_ShouldBeSetAndGottenCorrectly()
        {
            //Arrange
            var country = new Models.Locations.Country();

            //Act
            var city = new Models.Locations.City()
            {
                Country = country
            };

            //Assert
            Assert.AreSame(country, city.Country);
            Assert.AreEqual(country.Id, city.Country.Id);
        }
Beispiel #5
0
        public void Cities_ShouldBeSetAndGottenCorrectly()
        {
            //Arrange
            var cities = new List <Models.Locations.City> {
                new Models.Locations.City()
            };

            //Act
            var country = new Models.Locations.Country {
                Cities = cities
            };

            //Assert
            Assert.AreSame(cities[0], country.Cities.First());
            Assert.AreEqual(cities[0].Id, country.Cities.First().Id);
        }