private static LexicalUUIDType ConvertFrom(object o)
        {
            var type = new LexicalUUIDType();

            type.SetValue(o);
            return(type);
        }
        private static T ConvertTo <T>(LexicalUUIDType type)
        {
            if (type == null)
            {
                return(default(T));
            }

            return(type.GetValue <T>());
        }
        public void Guid_To_JavaBytes()
        {
            // arrange

            // act
            LexicalUUIDType actual = guid;

            // assert
            Assert.IsTrue(actual.GetValue <byte[]>().SequenceEqual(javaByteOrder));
        }
Example #4
0
        public void Guid_To_JavaBytes()
        {
            // arrange

            // act
            LexicalUUIDType actual = guid;

            // assert
            Assert.True(actual.ToBigEndian().SequenceEqual(javaByteOrder));
        }
        public void Implicit_Guid_Cast()
        {
            // arrange
            Guid expected = guid;

            // act
            LexicalUUIDType actual = expected;

            // assert
            Assert.AreEqual(expected, (Guid)actual);
        }
        public void JavaBytes_To_Guid()
        {
            // arrange

            // act
            LexicalUUIDType actual = new LexicalUUIDType();

            actual.SetValue(javaByteOrder);

            // assert
            Assert.AreEqual(guid, (Guid)actual);
        }
        public void Operator_NotEqualTo()
        {
            // arrange
            var             value = guid;
            LexicalUUIDType type  = value;

            // act
            bool actual = !type.Equals(value);

            // assert
            Assert.IsFalse(actual);
        }
        public void CassandraType_Cast()
        {
            // arranage
            Guid            expected   = guid;
            LexicalUUIDType actualType = expected;

            // act
            CassandraType actual = actualType;

            // assert
            Assert.AreEqual(expected, (Guid)actual);
        }
Example #9
0
        public void Null_to_Guid()
        {
            // arrange

            // act
            LexicalUUIDType actual = new LexicalUUIDType();

            actual.SetValueFromBigEndian(null);

            // assert
            Assert.Equal(Guid.Empty, (Guid)actual);
        }
        public void Implicit_ByteArray_Cast()
        {
            // arrange
            byte[] expected = dotNetByteOrder;

            // act
            LexicalUUIDType actualType = expected;

            byte[] actual = actualType;

            // assert
            Assert.IsTrue(expected.SequenceEqual(actual));
        }