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); }
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); }