Esempio n. 1
0
        public async Task WithNullPayloadRequestReturnsBadRequest()
        {
            // arrange
            Mock <AbstractLogger> mockLogger = new Mock <AbstractLogger>();
            var mockRequest = Mockers.MockRequestWithNoPayload();
            var sut         = AudioMockers.GetApiFunctionsWithBlobUploaded(
                out Mock <IUserAuthenticationService> mockUserAuth,
                out FakeBlobRepository fakeRepository,
                out Mock <IEventGridPublisherService> mockEventGridPublisherService);

            // act
            var response = await sut.AddComplete(mockRequest.Object, mockLogger.Object, Mockers.DefaultId).ConfigureAwait(false);

            var responseType = (BadRequestObjectResult)response;

            Assert.IsNotNull(responseType);
            Assert.AreEqual("Missing required property 'categoryId'.", ((dynamic)responseType.Value).error);
        }