Ejemplo n.º 1
0
        [TestMethod] public void LookupNullableDecimal()
        {
            // Arrange
            var type = typeof(decimal?);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.Decimal);
        }
Ejemplo n.º 2
0
        [TestMethod] public void LookupUShort()
        {
            // Arrange
            var type = typeof(ushort);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.UInt16);
        }
Ejemplo n.º 3
0
        [TestMethod] public void LookupNullableEnum()
        {
            // Arrange
            var type = typeof(DataAccessMethod?);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.Enumeration);
        }
Ejemplo n.º 4
0
        [TestMethod] public void LookupNullableSbyte()
        {
            // Arrange
            var type = typeof(sbyte?);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.Int8);
        }
Ejemplo n.º 5
0
        [TestMethod] public void LookupNullableFloat()
        {
            // Arrange
            var type = typeof(float?);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.Single);
        }
Ejemplo n.º 6
0
        [TestMethod] public void LookupNullableULong()
        {
            // Arrange
            var type = typeof(ulong?);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.UInt64);
        }
Ejemplo n.º 7
0
        [TestMethod] public void LookupChar()
        {
            // Arrange
            var type = typeof(char);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.Character);
        }
Ejemplo n.º 8
0
        [TestMethod] public void LookupBool()
        {
            // Arrange
            var type = typeof(bool);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.Boolean);
        }
Ejemplo n.º 9
0
        [TestMethod] public void LookupString()
        {
            // Arrange
            var type = typeof(string);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.Text);
        }
Ejemplo n.º 10
0
        [TestMethod] public void LookupDateTime()
        {
            // Arrange
            var type = typeof(DateTime);

            // Act
            var supported = DBType.IsSupported(type);
            var dbType    = DBType.Lookup(type);

            // Assert
            supported.Should().BeTrue();
            dbType.Should().Be(DBType.DateTime);
        }
Ejemplo n.º 11
0
        [TestMethod] public void LookupCollection()
        {
            // Arrange
            var type = typeof(List <string>);

            // Act
            var           supported = DBType.IsSupported(type);
            Func <DBType> action    = () => DBType.Lookup(type);

            // Assert
            supported.Should().BeFalse();
            action.Should().ThrowExactly <ArgumentException>()
            .WithAnyMessage()
            .And
            .ParamName.Should().NotBeNullOrEmpty();
        }