Exemplo n.º 1
0
        public void Should_Create_DateTime_From_Entry()
        {
            // arrange
            DynamoDBEntry entry = new Primitive {
                Value = "2020-01-01"
            };
            var converter = new DynamoDateConverter();
            var expected  = new DateTime(2020, 1, 1);

            // act
            var date = converter.FromEntry(entry);

            // assert
            Assert.Equal(expected, date);
        }
Exemplo n.º 2
0
        public void Should_Return_DateTime_Minvalue_From_Null(string input)
        {
            // arrange
            DynamoDBEntry entry = new Primitive {
                Value = input
            };
            var converter = new DynamoDateConverter();
            var expected  = DateTime.MinValue;

            // act
            var date = converter.FromEntry(entry);

            // assert
            Assert.Equal(expected, date);
        }