Example #1
0
        public void Collapse_NoneReceivesMethodWhichReturnsAlternateValue_ReturnsThatValue()
        {
            T           expectedValue = this.AlternateSampleValue;
            IOption <T> option        = this.CreateNone();
            T           actualValue   = option.Fold(() => expectedValue);

            Assert.True(this.AreSame(expectedValue, actualValue));
        }
Example #2
0
        public void Collapse_SomeContainingValue_ReturnsContainedValue()
        {
            T           expectedValue = this.SampleValue;
            IOption <T> option        = this.CreateSome(expectedValue);
            T           actualValue   = option.Fold(() => this.AlternateSampleValue);

            Assert.True(this.AreSame(expectedValue, actualValue));
        }