Пример #1
0
        public async Task ShouldReturnCreatedAtRouteOnCallCreate()
        {
            CreateUserRequestModel model = new CreateUserRequestModel()
            {
                Email = "*****@*****.**", Name = "New User Name", Password = "******"
            };
            HttpResponseMessage httpResponse = await _httpClient.PostAsync("../users", _createRequestHelper.CreateStringContent(model));

            Assert.Equal((int)HttpStatusCode.Created, (int)httpResponse.StatusCode);
            _database.ResetDatabase();
        }
        public async Task ShouldThrowUnauthorizedOnCallCreate()
        {
            HttpResponseMessage response = await _httpClient.PostAsync($"../reviews/{Guid.NewGuid().ToString()}/comments", _createRequestHelper.CreateStringContent(new { }));

            Assert.Equal((int)HttpStatusCode.Unauthorized, (int)response.StatusCode);
        }