Example #1
0
 public void RemoveEntityTest()
 {
     using (var gateway = new SimpleGatewayImpl())
     {
         gateway.Create(new CreateMessage(TestHelper.GetHouse()));
     }
 }
Example #2
0
 public void RemoveEntityTest()
 {
     using (var gateway = new SimpleGatewayImpl())
     {
         gateway.Create(new CreateMessage(TestHelper.GetHouse()));
     }
 }
Example #3
0
        public void AddInvalidHouseTest()
        {
            var newHouse = TestHelper.GetHouse();

            //Delete all rooms from the house to make it invalid
            newHouse.Room.Clear();

            var gatewayHouse = default(House);

            using (var gateway = new SimpleGatewayImpl())
            {
                try
                {
                    gatewayHouse = (House)gateway.Create(new CreateMessage(newHouse));
                }
                catch (Exception ex)
                {
                    Assert.Fail(ex.Message);
                }
            }

            Assert.AreSame(newHouse, gatewayHouse);

            using (var db = new TweakTestDataEntities())
            {
                Assert.IsNotNull(db.HouseSet.ToList().FirstOrDefault(house => house.Address.Equals(newHouse.Address)));
            }
        }
Example #4
0
        public void AddInvalidHouseTest()
        {
            var newHouse = TestHelper.GetHouse();

            //Delete all rooms from the house to make it invalid
            newHouse.Room.Clear();

            var gatewayHouse = default(House);

            using (var gateway = new SimpleGatewayImpl())
            {
                try
                {
                    gatewayHouse = (House)gateway.Create(new CreateMessage(newHouse));
                }
                catch (Exception ex)
                {
                    Assert.Fail(ex.Message);
                }
            }

            Assert.AreSame(newHouse, gatewayHouse);

            using (var db = new TweakTestDataEntities())
            {
                Assert.IsNotNull(db.HouseSet.ToList().FirstOrDefault(house => house.Address.Equals(newHouse.Address)));
            }
        }