コード例 #1
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #2
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #3
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #4
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #5
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #6
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #7
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #8
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #9
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #10
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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);
        }
コード例 #11
0
ファイル: DBType.cs プロジェクト: justin-millman/Kvasir
        [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();
        }