public void QueryForModelHash_returns_null_if_the_EdmMetadata_has_row_with_null_model_hash() { var repository = new EdmMetadataRepository("Database=Foo", SqlClientFactory.Instance); var mockContext = CreateMockContext((string)null); Assert.Null(repository.QueryForModelHash(c => mockContext.Object)); }
public void QueryForModelHash_returns_the_last_model_hash_if_more_than_one_exists() { var repository = new EdmMetadataRepository("Database=Foo", SqlClientFactory.Instance); var mockContext = CreateMockContext("Hash1", "Hash2", "Hash3"); Assert.Equal("Hash3", repository.QueryForModelHash(c => mockContext.Object)); }
public void QueryForModelHash_returns_null_if_the_EdmMetadata_table_is_missing() { var repository = new EdmMetadataRepository("Database=Foo", SqlClientFactory.Instance); var mockContext = CreateMockContext("Hash"); mockContext.Setup(m => m.Metadata).Throws(new EntityCommandExecutionException()); Assert.Null(repository.QueryForModelHash(c => mockContext.Object)); }