Esempio n. 1
0
        public void NotParseIncorrectEnumValue()
        {
            RuntimePolicy result;

            Assert.False(Net35Backport.TryParseEnum("bad string", true, out result));
            Assert.Equal(default(RuntimePolicy), result);
        }
Esempio n. 2
0
        public void ParseCorrectEnumValue()
        {
            RuntimePolicy result;

            Assert.True(Net35Backport.TryParseEnum("on", true, out result));
            Assert.Equal(RuntimePolicy.On, result);
        }
Esempio n. 3
0
        public void NotParseIncorrectGuidStrings()
        {
            var  guid = "crap";
            Guid output;

            Assert.False(Net35Backport.TryParseGuid(guid, out output));
            Assert.Equal(default(Guid), output);
        }
Esempio n. 4
0
        public void ParseCorrectGuidStrings()
        {
            var  guid = Guid.NewGuid();
            Guid output;

            Assert.True(Net35Backport.TryParseGuid(guid.ToString(), out output));
            Assert.Equal(guid, output);
        }
Esempio n. 5
0
 public void HandleIsNullOrWhiteSpace()
 {
     Assert.True(Net35Backport.IsNullOrWhiteSpace(null));
     Assert.True(Net35Backport.IsNullOrWhiteSpace("       "));
     Assert.False(Net35Backport.IsNullOrWhiteSpace("any string"));
 }