Exemple #1
0
        public void Valid_email_is_ok()
        {
            // Arrange
            var validEmail = "*****@*****.**";

            // Act
            var result = EmailAddressSimpleCreator.CreateFrom(validEmail);

            // Assert
            result.Should().BeOfType <Option <EmailAddressSimple> >();
            //result.Should().BeEquivalentTo(EmailAddressSimpleCreator.CreateFrom(validEmail));
            //result.Match(
            //    () => true.Should().BeFalse(),
            //    x => x.Should().Be(validEmail));
        }
Exemple #2
0
        public void Empty_string_returns_error()
        {
            // Arrange
            var emptyString = string.Empty;

            // Act
            var result = EmailAddressSimpleCreator.CreateFrom(emptyString);

            // Assert
            result.Should().BeOfType <Option <EmailAddressSimple> >();
            //result.Should().BeEquivalentTo(None);
            result.Match(
                () => true.Should().BeTrue(),
                x => x.Should().BeNull());
        }