コード例 #1
0
        public void CreateNewBuildingPropertyTestWithoutOwnerId()
        {
            RealEstateXPOServices realEstate = new RealEstateXPOServices(_uow);
            var property = new PropertyModelView {
                Address = "AddressTest", CodeInternal = "Code", IdOwner = 0, IdProperty = 1, Name = "NameTest", Price = 2540, Year = 2015
            };

            Assert.ThrowsAsync <Exception>(async() => await realEstate.CreatePropertyBuildingAsync(property));
        }
コード例 #2
0
        public async Task CreateNewBuildingPropertyTestCreateDefaultOwner()
        {
            RealEstateXPOServices realEstate = new RealEstateXPOServices(_uow);
            var property = new PropertyModelView {
                Address = "AddressTest", CodeInternal = "Code", IdOwner = -1, IdProperty = 1, Name = "NameTest", Price = 2540, Year = 2015
            };
            var result = await realEstate.CreatePropertyBuildingAsync(property);

            Assert.IsTrue(result > 0);
        }