public virtual async void TestDelete()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);
            var        client     = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;

            IRowVersionCheckService service = testServer.Host.Services.GetService(typeof(IRowVersionCheckService)) as IRowVersionCheckService;
            var model = new ApiRowVersionCheckServerRequestModel();

            model.SetProperties("B", Guid.Parse("3842cac4-b9a0-8223-0dcc-509a6f75849b"));
            CreateResponse <ApiRowVersionCheckServerResponseModel> createdResponse = await service.Create(model);

            createdResponse.Success.Should().BeTrue();

            ActionResponse deleteResult = await client.RowVersionCheckDeleteAsync(2);

            deleteResult.Success.Should().BeTrue();
            ApiRowVersionCheckServerResponseModel verifyResponse = await service.Get(2);

            verifyResponse.Should().BeNull();
        }
        public void MapServerRequestToResponse()
        {
            var mapper = new ApiRowVersionCheckServerModelMapper();
            var model  = new ApiRowVersionCheckServerRequestModel();

            model.SetProperties("A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            ApiRowVersionCheckServerResponseModel response = mapper.MapServerRequestToResponse(1, model);

            response.Should().NotBeNull();
            response.Name.Should().Be("A");
            response.RowVersion.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
        }
        public async void Get_ShouldReturnNullBecauseRecordNotFound()
        {
            var mock = new ServiceMockFacade <IRowVersionCheckService, IRowVersionCheckRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <RowVersionCheck>(null));
            var service = new RowVersionCheckService(mock.LoggerMock.Object,
                                                     mock.MediatorMock.Object,
                                                     mock.RepositoryMock.Object,
                                                     mock.ModelValidatorMockFactory.RowVersionCheckModelValidatorMock.Object,
                                                     mock.DALMapperMockFactory.DALRowVersionCheckMapperMock);

            ApiRowVersionCheckServerResponseModel response = await service.Get(default(int));

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }