Ejemplo n.º 1
0
        public void Feature_observable_returns_feature_from_object_ctor()
        {
            var feature = new Feature<string>((object) "hello");

            feature.Subscribe(v => { });

            Assert.That(feature.First(), Is.EqualTo("hello"));
        }
Ejemplo n.º 2
0
        public void Feature_observable_returns_feature_from_object_ctor_when_passed_a_delegate()
        {
            Func<object> getter = () => "hello";
            var feature = new Feature<string>(getter);

            feature.Subscribe(v => { });

            Assert.That(feature.First(), Is.EqualTo("hello"));
        }
Ejemplo n.º 3
0
        public void A_Feature_whose_instance_is_an_IFeature_produces_a_value_when_the_IFeature_is_available()
        {
            var inner = new Feature<string>();
            var outer = new Feature<Feature<string>>(inner);
            Feature<string> result = null;

            outer.Subscribe(v => result = v);

            inner.OnNext("hello");

            Assert.That(outer.Availability.First(), Is.EqualTo(true));
            Assert.That(outer.First().First(), Is.EqualTo("hello"));
        }