public void AllNamedColumnsMustBeNullableConventionSpecification_Success() { ExecuteSqlScriptFromResource("AllNamedColumnsMustBeNullableConventionalSpecification_Success.sql"); TheDatabase .WithConnectionString(_settings.ConnectionString) .MustConformTo(Convention.AllNamedColumnsMustBeNullable("UpdatedDateTime")) .IsSatisfied .Should() .BeTrue(); }
public void AllUniqueConstraintsMustBeNamedConventionalSpecification_Success() { ExecuteSqlScriptFromResource("AllUniqueConstraintsMustBeNamedConventionalSpecification_Success.sql"); TheDatabase .WithConnectionString(_settings.ConnectionString) .MustConformTo(Convention.AllUniqueConstraintsMustBeNamed) .IsSatisfied .Should() .BeTrue(); }
public void AllUniqueConstraintsMustBeNamedConventionalSpecification_Fail() { ExecuteSqlScriptFromResource("AllUniqueConstraintsMustBeNamedConventionalSpecification_Fail.sql"); var result = TheDatabase .WithConnectionString(_settings.ConnectionString) .MustConformTo(Convention.AllUniqueConstraintsMustBeNamed); result.IsSatisfied.Should().BeFalse(); result.Failures.Should().HaveCount(1); }
public void EachRowMustHaveACorrespondingEnum_Success() { ExecuteSqlScriptFromResource("EachRowMustHaveACorrespondingEnum_Success.sql"); TheDatabase .WithConnectionString(TestDbConnectionString) .MustConformTo(Convention.EachRowMustHaveACorrespondingEnum <CloudServiceEnum>("dbo.CloudService", "CloudServiceId")) .IsSatisfied .Should() .BeTrue(); }
public void EachRowMustHaveACorrespondingEnum_Fail() { ExecuteSqlScriptFromResource("EachRowMustHaveACorrespondingEnum_Fail.sql"); var result = TheDatabase .WithConnectionString(TestDbConnectionString) .MustConformTo(Convention.EachRowMustHaveACorrespondingEnum <CloudServiceEnum>("dbo.CloudService", "CloudServiceId")); result.IsSatisfied.Should().BeFalse(); result.Failures.Should().HaveCount(1); }
public void AllTablesMustHaveAClusteredIndex_Failure() { ExecuteSqlScriptFromResource("TablesWithoutClusteredIndexFailure.sql"); var result = TheDatabase .WithConnectionString(TestDbConnectionString) .MustConformTo(Convention.AllTablesMustHaveAClusteredIndex); result.IsSatisfied.Should().BeFalse(); result.Failures.Should().HaveCount(1); }
public void AllTablesMustHaveAClusteredIndex_Success() { ExecuteSqlScriptFromResource("TablesWithoutClusteredIndexSuccess.sql"); TheDatabase .WithConnectionString(TestDbConnectionString) .MustConformTo(Convention.AllTablesMustHaveAClusteredIndex) .IsSatisfied .Should() .BeTrue(); }
public void AllIdentityColumnsMustBeNamedTableNameIdConventionSpecification_FailsWhenIdentityColumnIsNotNamedId() { ExecuteSqlScriptFromResource("AllIdentityColumnsMustBeNamedTableNameIdConventionSpecificationFailure.sql"); var result = TheDatabase .WithConnectionString(TestDbConnectionString) .MustConformTo(Convention.AllIdentityColumnsMustBeNamedTableNameId); result.IsSatisfied.Should().BeFalse(); result.Failures.Should().HaveCount(1); }
public void AllIdentityColumnsMustBeNamedTableNameIdConventionSpecification_Success() { ExecuteSqlScriptFromResource("AllIdentityColumnsMustBeNamedTableNameIdConventionSpecificationSuccess.sql"); TheDatabase .WithConnectionString(TestDbConnectionString) .MustConformTo(Convention.AllIdentityColumnsMustBeNamedTableNameId) .IsSatisfied .Should() .BeTrue(); }
public void AllNamedColumnsMustBeNullableConventionSpecification_Fails() { ExecuteSqlScriptFromResource("AllNamedColumnsMustBeNullableConventionalSpecification_Fail.sql"); var result = TheDatabase .WithConnectionString(TestDbConnectionString) .MustConformTo(Convention.AllNamedColumnsMustBeNullable("UpdatedDateTime")); result.IsSatisfied.Should().BeFalse(); result.Failures.Should().HaveCount(1); }