예제 #1
0
        public void TestKnownIntValue()
        {
            var computedInt = Computed.Create(88);

            Assert.True(computedInt.IsKnown);
            Assert.Equal(88, computedInt.Value);
            Assert.Equal(88, computedInt.ValueOrDefault());
            Assert.Equal(88, computedInt.ValueOrDefault(99));
            Assert.Equal <int>(88, computedInt);
        }
예제 #2
0
        public void TestKnownStringValue()
        {
            var computedString = Computed.Create("FOO");

            Assert.True(computedString.IsKnown);
            Assert.Equal("FOO", computedString.Value);
            Assert.Equal("FOO", computedString.ValueOrDefault());
            Assert.Equal("FOO", computedString.ValueOrDefault("noval"));
            Assert.Equal("FOO", computedString);
        }