예제 #1
0
        public async void TestDelete()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

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

            var createModel = new ApiPipelineStepNoteRequestModel();

            createModel.SetProperties(1, "B", 1);
            CreateResponse <ApiPipelineStepNoteResponseModel> createResult = await client.PipelineStepNoteCreateAsync(createModel);

            createResult.Success.Should().BeTrue();

            ApiPipelineStepNoteResponseModel getResponse = await client.PipelineStepNoteGetAsync(2);

            getResponse.Should().NotBeNull();

            ActionResponse deleteResult = await client.PipelineStepNoteDeleteAsync(2);

            deleteResult.Success.Should().BeTrue();

            ApiPipelineStepNoteResponseModel verifyResponse = await client.PipelineStepNoteGetAsync(2);

            verifyResponse.Should().BeNull();
        }
예제 #2
0
        private async Task <ApiPipelineStepNoteResponseModel> CreateRecord()
        {
            var model = new ApiPipelineStepNoteRequestModel();

            model.SetProperties(1, "B", 1);
            CreateResponse <ApiPipelineStepNoteResponseModel> result = await this.Client.PipelineStepNoteCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
예제 #3
0
        public void MapModelToBO()
        {
            var mapper = new BOLPipelineStepNoteMapper();
            ApiPipelineStepNoteRequestModel model = new ApiPipelineStepNoteRequestModel();

            model.SetProperties(1, "A", 1);
            BOPipelineStepNote response = mapper.MapModelToBO(1, model);

            response.EmployeeId.Should().Be(1);
            response.Note.Should().Be("A");
            response.PipelineStepId.Should().Be(1);
        }
예제 #4
0
        public void MapRequestToResponse()
        {
            var mapper = new ApiPipelineStepNoteModelMapper();
            var model  = new ApiPipelineStepNoteRequestModel();

            model.SetProperties(1, "A", 1);
            ApiPipelineStepNoteResponseModel response = mapper.MapRequestToResponse(1, model);

            response.EmployeeId.Should().Be(1);
            response.Id.Should().Be(1);
            response.Note.Should().Be("A");
            response.PipelineStepId.Should().Be(1);
        }
예제 #5
0
        public void CreatePatch()
        {
            var mapper = new ApiPipelineStepNoteModelMapper();
            var model  = new ApiPipelineStepNoteRequestModel();

            model.SetProperties(1, "A", 1);

            JsonPatchDocument <ApiPipelineStepNoteRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiPipelineStepNoteRequestModel();

            patch.ApplyTo(response);
            response.EmployeeId.Should().Be(1);
            response.Note.Should().Be("A");
            response.PipelineStepId.Should().Be(1);
        }