public void NotParseIncorrectEnumValue() { RuntimePolicy result; Assert.False(Net35Backport.TryParseEnum("bad string", true, out result)); Assert.Equal(default(RuntimePolicy), result); }
public void ParseCorrectEnumValue() { RuntimePolicy result; Assert.True(Net35Backport.TryParseEnum("on", true, out result)); Assert.Equal(RuntimePolicy.On, result); }
public void NotParseIncorrectGuidStrings() { var guid = "crap"; Guid output; Assert.False(Net35Backport.TryParseGuid(guid, out output)); Assert.Equal(default(Guid), output); }
public void ParseCorrectGuidStrings() { var guid = Guid.NewGuid(); Guid output; Assert.True(Net35Backport.TryParseGuid(guid.ToString(), out output)); Assert.Equal(guid, output); }
public void HandleIsNullOrWhiteSpace() { Assert.True(Net35Backport.IsNullOrWhiteSpace(null)); Assert.True(Net35Backport.IsNullOrWhiteSpace(" ")); Assert.False(Net35Backport.IsNullOrWhiteSpace("any string")); }