Beispiel #1
0
        public void TestShouldCreateText_Validate_Invalid()
        {
            // Given
            var    origin = Origin.Create(Guids.One(), nameof(TimestampTests), nameof(TestShouldCreateText_Validate_Valid));
            string str    = "  ";

            // When
            var result = Text.Create(str, origin);

            // Then
            Assert.IsTrue(result.IsInvalid());
        }
Beispiel #2
0
        public void TestShouldCreateText_Validate_Valid()
        {
            // Given
            var    origin = Origin.Create(Guids.One(), nameof(TimestampTests), nameof(TestShouldCreateText_Validate_Valid));
            string str    = "Test";

            // When
            var result = Text.Create(str, origin);

            // Then
            Assert.IsTrue(result.IsValid);
            Assert.AreEqual(str, result.GetOrException().ToString());
        }
Beispiel #3
0
        public void TestShouldCreateTimestamp_Validate_Valid()
        {
            // Given
            var now    = new DateTime(2020, 12, 21, 7, 7, 7);
            var origin = Origin.Create(Guids.One(), nameof(TimestampTests), nameof(TestShouldCreateTimestamp_Validate_Valid));

            // When
            var result = Timestamp.Create(now, origin);

            // Then
            Assert.IsTrue(result.IsValid);
            DateTime actual = result.GetOrException();

            Assert.AreEqual(now, actual);
        }