public async Task TestPutUserVoteAsync()
        {
            // Arrange
            var request = new
            {
                Url  = "/api/pizzavotes/[email protected]",
                Body = new
                {
                    Value    = 2,
                    DateTime = DateTime.Now
                }
            };

            // Act
            var response = await Client.PutAsync(request.Url, ContentHelper.GetStringContent(request.Body));

            // Assert
            Assert.Equal("Unauthorized", response.StatusCode.ToString());
        }
Exemple #2
0
        public async Task TestPostVoteAsync()
        {
            // Arrange
            var request = new
            {
                Url  = "/api/pizzavotes",
                Body = new
                {
                    Id       = "*****@*****.**",
                    Value    = 1,
                    DateTime = DateTime.Now
                }
            };

            // Act
            var response = await Client.PostAsync(request.Url, ContentHelper.GetStringContent(request.Body));

            var value = await response.Content.ReadAsStringAsync();

            // Assert
            Assert.Equal("Unauthorized", response.StatusCode.ToString());
        }