Ejemplo n.º 1
0
        public void Map_NoneReceivesMappingToObject_ReturnsNone()
        {
            IOption <T>    option = this.CreateNone();
            IOption <TMap> mapped = option.Map(_ => this.SampleMapToValue);

            Assert.Equal(0, mapped.AsEnumerable().Count());
        }
Ejemplo n.º 2
0
        public void Map_SomeReceivesMappingToObject_ReturnsSomeOfThatObject()
        {
            TMap mappedValue = this.SampleMapToValue;

            IOption <T>    option = this.CreateSome(this.SampleValue);
            IOption <TMap> mapped = option.Map(_ => mappedValue);

            Assert.Same(mappedValue, mapped.AsEnumerable().ElementAt(0));
        }