Example #1
0
        public void Creating_a_zipcode_from_None_works()
        {
            var result = ZipcodeFP.Create(F.None);

            result.Match(
                () => AssertionHelper.NoneIsTrue(),
                x => false.Should().BeTrue());
        }
Example #2
0
        public void Creating_a_zipcode_from_NonEmptyString_works(string input, bool isValid)
        {
            var result = ZipcodeFP.Create(NonEmptyStringFP.Create(input));

            if (isValid)
            {
                result.Match(
                    AssertionHelper.NoneFails,
                    x => x.ToString().Should().Be(input));
            }
            else
            {
                result.Match(
                    AssertionHelper.NoneIsTrue,
                    x => x.ToString().Should().NotBe(input));
            }
        }