Beispiel #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiOctopusServerNodeModelMapper();
            var model  = new ApiOctopusServerNodeResponseModel();

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

            response.IsInMaintenanceMode.Should().Be(true);
            response.JSON.Should().Be("A");
            response.LastSeen.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"));
            response.MaxConcurrentTasks.Should().Be(1);
            response.Name.Should().Be("A");
            response.Rank.Should().Be("A");
        }
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiOctopusServerNodeModelMapper mapper = new ApiOctopusServerNodeModelMapper();

            UpdateResponse <ApiOctopusServerNodeResponseModel> updateResponse = await this.Client.OctopusServerNodeUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

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

            await this.Cleanup();
        }