예제 #1
0
        public void CanAddPurchaseVehicle()
        {
            PurchaseVehicle purchaseToAdd = new PurchaseVehicle();
            var             repo          = new PurchaseVehicleRepositoryADO();

            purchaseToAdd.CarId          = 1;
            purchaseToAdd.UserId         = "00000000-0000-0000-000000000000";
            purchaseToAdd.SpecialId      = 2;
            purchaseToAdd.PurchaseTypeId = 2;
            purchaseToAdd.StateId        = "IN";
            purchaseToAdd.CustomerName   = "Kevin";
            purchaseToAdd.Phone          = "111-111-1111";
            purchaseToAdd.Email          = "*****@*****.**";
            purchaseToAdd.Street1        = "2 Two St";
            purchaseToAdd.Street2        = "Apt 2";
            purchaseToAdd.City           = "New York";
            purchaseToAdd.ZipCode        = 11211;
            purchaseToAdd.PurchasePrice  = 10000M;
            purchaseToAdd.PurchaseDate   = DateTime.Parse("2/2/22");

            repo.Insert(purchaseToAdd);

            Assert.AreEqual(2, purchaseToAdd.PurchaseVehicleId);
        }
예제 #2
0
        public void CanLoadPurchaseVehicles()
        {
            var repo = new PurchaseVehicleRepositoryADO();

            var purchaseVehicle = repo.GetAll();

            Assert.AreEqual(1, purchaseVehicle.Count());

            Assert.AreEqual(1, purchaseVehicle[0].PurchaseVehicleId);
            Assert.AreEqual(1, purchaseVehicle[0].CarId);
            Assert.AreEqual("00000000-0000-0000-000000000000", purchaseVehicle[0].UserId);
            Assert.AreEqual(1, purchaseVehicle[0].SpecialId);
            Assert.AreEqual(1, purchaseVehicle[0].PurchaseTypeId);
            Assert.AreEqual("OH", purchaseVehicle[0].StateId);
            Assert.AreEqual("Nate", purchaseVehicle[0].CustomerName);
            Assert.AreEqual("111-111-1111", purchaseVehicle[0].Phone);
            Assert.AreEqual("*****@*****.**", purchaseVehicle[0].Email);
            Assert.AreEqual("1 One Street", purchaseVehicle[0].Street1);
            Assert.AreEqual(null, purchaseVehicle[0].Street2);
            Assert.AreEqual("Louisville", purchaseVehicle[0].City);
            Assert.AreEqual(40210, purchaseVehicle[0].ZipCode);
            Assert.AreEqual(10000M, purchaseVehicle[0].PurchasePrice);
            Assert.AreEqual("1/1/2011", purchaseVehicle[0].PurchaseDate.ToShortDateString());
        }