public void RemoveEntityTest() { using (var gateway = new SimpleGatewayImpl()) { gateway.Create(new CreateMessage(TestHelper.GetHouse())); } }
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))); } }