Esempio n. 1
0
        [TestMethod] public void CreateFromUShortDirectly()
        {
            // Arrange
            var rawValue     = (ushort)102;
            var expectedType = DBType.UInt16;

            // Act
            var value   = new DBValue(rawValue);
            var matches = value.IsInstanceOf(expectedType);

            // Assert
            value.Datum.Should().Be(rawValue);
            matches.Should().BeTrue();
        }
Esempio n. 2
0
        [TestMethod] public void CreateFromDecimalDirectly()
        {
            // Arrange
            var rawValue     = (decimal)86.77;
            var expectedType = DBType.Decimal;

            // Act
            var value   = new DBValue(rawValue);
            var matches = value.IsInstanceOf(expectedType);

            // Assert
            value.Datum.Should().Be(rawValue);
            matches.Should().BeTrue();
        }
Esempio n. 3
0
        [TestMethod] public void CreateFromCharDirectly()
        {
            // Arrange
            var rawValue     = '%';
            var expectedType = DBType.Character;

            // Act
            var value   = new DBValue(rawValue);
            var matches = value.IsInstanceOf(expectedType);

            // Assert
            value.Datum.Should().Be(rawValue);
            matches.Should().BeTrue();
        }
Esempio n. 4
0
        [TestMethod] public void CreateFromFloatDirectly()
        {
            // Arrange
            var rawValue     = -99.000102f;
            var expectedType = DBType.Single;

            // Act
            var value   = new DBValue(rawValue);
            var matches = value.IsInstanceOf(expectedType);

            // Assert
            value.Datum.Should().Be(rawValue);
            matches.Should().BeTrue();
        }
Esempio n. 5
0
        [TestMethod] public void CreateFromStringDirectly()
        {
            // Arrange
            var rawValue     = "Kvasir";
            var expectedType = DBType.Text;

            // Act
            var value   = new DBValue(rawValue);
            var matches = value.IsInstanceOf(expectedType);

            // Assert
            value.Datum.Should().Be(rawValue);
            matches.Should().BeTrue();
        }
Esempio n. 6
0
        [TestMethod] public void CreateFromGuidDirectly()
        {
            // Arrange
            var rawValue     = new Guid(0, 1, 1, new byte[] { 2, 3, 5, 8, 13, 21, 34, 55 });
            var expectedType = DBType.Guid;

            // Act
            var value   = new DBValue(rawValue);
            var matches = value.IsInstanceOf(expectedType);

            // Assert
            value.Datum.Should().Be(rawValue);
            matches.Should().BeTrue();
        }
Esempio n. 7
0
        [TestMethod] public void CreateFromDateTimeDirectly()
        {
            // Arrange
            var rawValue     = new DateTime(1996, 02, 29);
            var expectedType = DBType.DateTime;

            // Act
            var value   = new DBValue(rawValue);
            var matches = value.IsInstanceOf(expectedType);

            // Assert
            value.Datum.Should().Be(rawValue);
            matches.Should().BeTrue();
        }
Esempio n. 8
0
        [TestMethod] public void CreateFromULongDirectly()
        {
            // Arrange
            var rawValue     = 111110108ul;
            var expectedType = DBType.UInt64;

            // Act
            var value   = new DBValue(rawValue);
            var matches = value.IsInstanceOf(expectedType);

            // Assert
            value.Datum.Should().Be(rawValue);
            matches.Should().BeTrue();
        }