예제 #1
0
        public void ReturnCorrectLot_WhenVinIsValid(string vin, string locationOnLot)
        {
            //Arrange

            //Act
            var result = autoControl.FindCar(vin);

            //Assert
            Assert.AreEqual(locationOnLot, result.LocationOnLot);
        }
예제 #2
0
        public void ThrowVinNOtFoundExcepction_WhenRequestedCarIsNotFound()
        {
            //Arrange

            Mock <SUT.IAutoDBAccess> myInventory = new Mock <SUT.IAutoDBAccess>();

            myInventory.Setup(x => x.LoadLot()).Returns(AutoListTest());

            //Act
            var findCar = new SUT.AutoControl(myInventory.Object);

            // Assert
            Assert.ThrowsException <VINNotFoundException>(() => findCar.FindCar("07xxxxxxxxxxxxxxx"));
        }
예제 #3
0
        public void ReturnInstance_WhenRequestedCarIsFound()
        {
            //Arrange

            Mock <SUT.IAutoDBAccess> myMockDBA = new Mock <SUT.IAutoDBAccess>();

            myMockDBA.Setup(x => x.LoadLot()).Returns(AutoListTest());
            var myFindCar = new SUT.AutoControl(myMockDBA.Object);

            //Act
            var result = myFindCar.FindCar("06xxxxxxxxxxxxxxx");

            //Assert

            Assert.AreEqual("06xxxxxxxxxxxxxxx", result.VehicleIdentificationNumber);
        }