예제 #1
0
        public void Create_MissingCar_Fails()
        {
            var car = VehiclesTestData.CreateCar();

            _repoMock.Setup(r => r.Exists(car.Name)).Returns(false);

            var request = DiaryTestData.CreateCreationDto(car.Name);

            var result = _unitUnderTest.Create(request);

            Assert.AreEqual(HttpStatusCode.NotFound, result.StatusCode);
        }
예제 #2
0
        public void Create_ExistingCar_Passes()
        {
            var car = VehiclesTestData.CreateCar();

            _repoMock.Setup(r => r.Exists(car.Name)).Returns(true);


            var request = DiaryTestData.CreateCreationDto(car.Name);

            var result = _unitUnderTest.Create(request);

            Assert.AreEqual(HttpStatusCode.Accepted, result.StatusCode);
        }