public void AddUnitTest()
        {
            UnitDAL unitDAL = new UnitDAL(connectionString);
            Unit    unit    = new Unit()
            {
                PropertyID      = 1,
                MonthlyRent     = 999,
                SquareFeet      = 999,
                NumberOfBeds    = 9,
                NumberOfBaths   = 9,
                Description     = "9 Testing Rooms",
                Tagline         = "Never enough tests",
                ApplicationFee  = 99,
                SecurityDeposit = 999,
                PetDeposit      = 99,
                AddressLine1    = "99 Test Lane",
                City            = "Testville",
                State           = "Ohio",
                ZipCode         = 99999,
                WasherDryer     = false,
                AllowCats       = false,
                AllowDogs       = false,
                ParkingSpots    = "9 Car Garage",
                Gym             = false,
                Pool            = false
            };

            bool result = unitDAL.AddUnit(unit);

            Assert.IsTrue(result);
        }
Пример #2
0
 /// <summary>
 /// 添加单位
 /// </summary>
 public void AddUnit(Unit unit)
 {
     unit.CreatedTime = unit.UpdatedTime = DateTime.Now;
     dal.AddUnit(unit);
 }