Exemplo n.º 1
0
        public void ReturnCorrectLot_WhenVinIsValid(string vin, string locationOnLot)
        {
            //Arrange

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

            //Assert
            Assert.AreEqual(locationOnLot, result.LocationOnLot);
        }
Exemplo n.º 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"));
        }
Exemplo n.º 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);
        }