Exemple #1
0
        public async Task return_200_for_valid_photo_request()
        {
            var fakeResponse = Fake.GenerateDocument(fakeId, fakeDescription);

            controller = SetupControllerWithServiceReturningFakeObject(fakeResponse);
            var response = await controller.GetPhotoByPropertyId(fakeId.ToString());

            Assert.Equal((int)HttpStatusCode.OK, response.StatusCode);
        }
Exemple #2
0
        public async Task response_has_valid_content_if_photo_request_successful()
        {
            var fakeResponse = Fake.GenerateDocument(fakeId, fakeDescription);

            controller = SetupControllerWithServiceReturningFakeObject(fakeResponse);
            var response            = JObject.FromObject((await controller.GetPhotoByPropertyId(fakeId.ToString())).Value);
            var responseId          = response["results"][0]["Id"];
            var responseDescription = response["results"][0]["Description"];

            Assert.Equal(fakeId, responseId);
            Assert.Equal(fakeDescription, responseDescription);
        }
        public async Task return_type_should_be_list_of_documents()
        {
            var fakeResponse = Fake.GenerateDocument(123, null);

            fakeAsbestosService
            .Setup(m => m.GetDocument(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(Task.FromResult(fakeResponse));

            var asbestosAction = new AsbestosActions(fakeAsbestosService.Object, fakeLogger.Object);
            var response       = await asbestosAction.GetDocument(fakeId, null);

            Assert.True(response is List <Document>);
        }