Esempio n. 1
0
        private static AsciiType ConvertFrom(object o)
        {
            var type = new AsciiType();

            type.SetValue(o);
            return(type);
        }
Esempio n. 2
0
        private static T ConvertTo <T>(AsciiType type)
        {
            if (type == null)
            {
                return(default(T));
            }

            return(type.GetValue <T>());
        }
Esempio n. 3
0
        public void Implicit_String_Cast()
        {
            // arrange
            string expected = "The quick brown fox jumps over the lazy dog.";

            // act
            AsciiType actual = expected;

            // assert
            Assert.Equal(expected, (string)actual);
        }
Esempio n. 4
0
        public void Operator_NotEqualTo()
        {
            // arrange
            var       value = "The quick brown fox jumps over the lazy dog.";
            AsciiType type  = value;

            // act
            bool actual = type != value;

            // assert
            Assert.False(actual);
        }
Esempio n. 5
0
        public void CassandraType_Cast()
        {
            // arrange
            string    expected   = "The quick brown fox jumps over the lazy dog.";
            AsciiType actualType = expected;

            // act
            CassandraObject actual = actualType;

            // assert
            Assert.Equal(expected, (string)actual);
        }