コード例 #1
0
        public async void GetDifferenceRight_WhenExists_ShoulReturnHttp200()
        {
            // Arrange
            int id              = 2;
            var postUrl         = $"v1/Diff/{id}/right";
            var differenceRight = new DifferenceRight(id, "ewogICAgImlkIjoxLAogICAgIm5hbWUiOiJ0ZXN0ZSIKfQ==");
            var content         = ContentHelper.GetStringContent(differenceRight);
            var postResponse    = await _client.PostAsync(postUrl, content);

            var requestUrl = postUrl;

            // Act
            var response = await _client.GetAsync(requestUrl);

            // Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            //TODO: Test for content
        }
コード例 #2
0
        public async void GetDifference_WhenEqualSizeButDifferentValues_ShoulReturnSameSizeButDifferentData()
        {
            // Arrange
            int id             = 3;
            var postUrlLeft    = $"v1/Diff/{id}/left";
            var differenceleft = new DifferenceLeft(id, "ewogICAgImlkIjoxLAogICAgIm5hbWUiOiJ0ZXN0ZSIKfQ==");
            var contentLeft    = ContentHelper.GetStringContent(differenceleft);
            await _client.PostAsync(postUrlLeft, contentLeft);

            var postUrlRight    = $"v1/Diff/{id}/right";
            var differenceRight = new DifferenceRight(id, "ewogICAgImlkIjoxLAogICAgIm5hbWUiOiJ0ZXN0ZTIiCn0=");
            var contentRight    = ContentHelper.GetStringContent(differenceRight);
            await _client.PostAsync(postUrlRight, contentRight);

            var requestUrl = $"v1/Diff/{id}";

            // Act
            var response = await _client.GetAsync(requestUrl);

            // Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            //TODO: Test for content
        }