Пример #1
0
        public async Task CreateTimeEntryAsync_ShouldCreteTimeEntryAndReturnTimeEntryDtoImpl()
        {
            var now = DateTimeOffset.UtcNow;
            var timeEntryRequest = new TimeEntryRequest
            {
                Start = now,
            };
            var createResult = await _client.CreateTimeEntryAsync(_workspaceId, timeEntryRequest);

            createResult.IsSuccessful.Should().BeTrue();
            createResult.Data.Should().NotBeNull();
            createResult.Data.TimeInterval.Start.Should().BeCloseTo(now, 1.Seconds());
        }
Пример #2
0
        public static async Task <TimeEntryDtoImpl> CreateTestTimeEntryAsync(ClockifyClient client, string workspaceId, DateTimeOffset start, string projectId)
        {
            var timeEntryRequest = new TimeEntryRequest {
                Start     = start,
                End       = start.AddSeconds(30),
                ProjectId = projectId
            };

            var createResult = await client.CreateTimeEntryAsync(workspaceId, timeEntryRequest);

            createResult.IsSuccessful.Should().BeTrue();
            return(createResult.Data);
        }