예제 #1
0
        public void CanBeConstructed()
        {
            //Arrange
            ResultByTimeDto sut;

            //Act
            sut = new ResultByTimeDto();

            //Assert
            Assert.NotNull(sut);
        }
예제 #2
0
        public void CanBeSerialized()
        {
            //Arrange
            var sut = new ResultByTimeDto()
            {
                StartDate = DateTime.UtcNow,
                EndDate   = DateTime.UtcNow.AddDays(1),
                Estimated = true,
                Total     = new Dictionary <string, MetricValueDto>(),
                Groups    = new List <GroupDto>()
            };

            //Act
            var payload = JsonSerializer.Serialize(sut, new JsonSerializerOptions {
                IgnoreNullValues = true
            });

            //Assert
            Assert.NotNull(JsonDocument.Parse(payload));
        }