コード例 #1
0
        public void SetUp()
        {
            const int id = 4765;
            const string firstName = "Julie";
            const string lastName = "Li";
            var pet = new Pet {Id = 4987};
            var address = new Address("1234 Happy St", "Winnipeg", "MB", "R3B 2A2");

            _owner = new Owner
            {
                Id = id,
                FirstName = firstName,
                LastName = lastName,
                Address =address
            };

            _owner.AddPet(pet);

            var sameOwnerPlacedIntoSession = new Owner
            {
                Id = id,
                FirstName = firstName,
                LastName = lastName,
                Address = address
            };

            sameOwnerPlacedIntoSession.AddPet(pet);

            var sessionSource = FluentNHibernateMappingTester.GetNHibernateSessionWithWrappedEntity(sameOwnerPlacedIntoSession);
            _persistenceSpecification = new PersistenceSpecification<Owner>(sessionSource, new DomainEntityComparer());
        }
コード例 #2
0
 public void AddressProperty_Set_ValidatesEquality()
 {
     const string firstName = "Julie";
     const string lastName = "Smith";
     var sut = new Owner { FirstName = firstName, LastName = lastName };
     var address = new Address("1234 Main St.", "Winnipeg", "MB", "R3B 2A2");
     sut.Address = address;
     Assert.IsTrue(sut.Address.Equals(address));
 }
コード例 #3
0
 public void TwoInstances_SameParams_AreEqual()
 {
     var sut1 = new Address("1324 Happy St.", "Winnipeg", "MB", "R3G2A2");
     var sut2 = new Address("1324 Happy St.", "Winnipeg", "MB", "R3G2A2");
     Assert.IsTrue(sut1.Equals(sut2));
 }
コード例 #4
0
 public void Constructor_AllNullOrEmptyParams_ThrowsException()
 {
     var sut = new Address("", "", "", "");
 }