public static void SupportsDialect_GivenNonDialectType_ThrowsArgumentException() { var dialects = new[] { typeof(FakeDialect) }; var attr = new FakeModelledSchemaAttribute(dialects); Assert.That(() => attr.SupportsDialect(typeof(object)), Throws.ArgumentException); }
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); }
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); }
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); }