예제 #1
0
 public void Given_TheFollowingCountries(Table table)
 {
     foreach (var country in table.CreateSet <Country>())
     {
         CountriesToCreate.Add(country);
     }
 }
예제 #2
0
        public void Then_TheCountryShouldBeReturnedWithAnId()
        {
            foreach (var countryAdded in TestCountriesCreated)
            {
                var countryToAdd = CountriesToCreate.First(country => country.FullName == countryAdded.FullName);
                Assert.AreEqual(countryToAdd.Alpha2Code, countryAdded.Alpha2Code);
                Assert.AreEqual(countryToAdd.Alpha3Code, countryAdded.Alpha3Code);
                //TODO: figure out how to add a user for integration tests
                Assert.AreEqual(-365, countryAdded.CreatedByUserId);
                Assert.AreEqual(countryToAdd.EffectiveEndDate, countryAdded.EffectiveEndDate);
                Assert.AreEqual(countryToAdd.EffectiveStartDate, countryAdded.EffectiveStartDate);
                Assert.AreEqual(countryToAdd.FullName, countryAdded.FullName);
                Assert.AreEqual(countryToAdd.Iso3166Code, countryAdded.Iso3166Code);
                Assert.AreEqual(countryToAdd.PhoneNumberRegex, countryAdded.PhoneNumberRegex);
                Assert.AreEqual(countryToAdd.PostalCodeRegex, countryAdded.PostalCodeRegex);
                Assert.AreEqual(countryToAdd.ShortName, countryAdded.ShortName);

                Assert.AreNotEqual(countryToAdd.Id, countryAdded.Id);

                Assert.IsTrue(DateTimeOffset.UtcNow.AddSeconds(-1) < countryAdded.CreatedOn.UtcDateTime && countryAdded.CreatedOn.UtcDateTime < DateTimeOffset.UtcNow.AddSeconds(1));

                Assert.IsNull(countryAdded.LastUpdatedByUserId);
                Assert.IsNull(countryAdded.LastUpdatedOn);
            }
        }