public void MapResponseToRequest()
        {
            var mapper = new ApiFollowingModelMapper();
            var model  = new ApiFollowingResponseModel();

            model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A");
            ApiFollowingRequestModel response = mapper.MapResponseToRequest(model);

            response.DateFollowed.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Muted.Should().Be("A");
        }
Пример #2
0
        public async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            ApiFollowingResponseModel model = await client.FollowingGetAsync("A");

            ApiFollowingModelMapper mapper = new ApiFollowingModelMapper();

            UpdateResponse <ApiFollowingResponseModel> updateResponse = await client.FollowingUpdateAsync(model.UserId, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
        }