Beispiel #1
0
        public static void SupportsDialect_GivenNonDialectType_ThrowsArgumentException()
        {
            var dialects = new[] { typeof(FakeDialect) };
            var attr     = new FakeModelledSchemaAttribute(dialects);

            Assert.That(() => attr.SupportsDialect(typeof(object)), Throws.ArgumentException);
        }
Beispiel #2
0
        public static void SupportsDialect_WhenSupportsAllDialects_ReturnsTrue()
        {
            var dialects = new[] { Dialect.All };
            var attr     = new FakeModelledSchemaAttribute(dialects);

            var supportsDialect = attr.SupportsDialect(typeof(FakeDialect));

            Assert.That(supportsDialect, Is.True);
        }
Beispiel #3
0
        public static void SupportsDialect_GivenMatchingDialectType_ReturnsTrue()
        {
            var dialects = new[] { typeof(FakeDialect) };
            var attr     = new FakeModelledSchemaAttribute(dialects);

            var supportsDialect = attr.SupportsDialect(typeof(FakeDialect));

            Assert.That(supportsDialect, Is.True);
        }
Beispiel #4
0
        public static void SupportsDialect_GivenNonMatchingDialectType_ReturnsFalse()
        {
            var dialectMock      = Mock.Of <IDatabaseDialect>();
            var mockInstanceType = dialectMock.GetType();
            var dialects         = new[] { mockInstanceType };
            var attr             = new FakeModelledSchemaAttribute(dialects);

            var supportsDialect = attr.SupportsDialect(typeof(FakeDialect));

            Assert.That(supportsDialect, Is.False);
        }