public async Task Should_Parse_Number_Followed_By_Parenthesis(string query, int[] expected) { // Given, When var result = await TestQueryRunner.Execute(query, DefaultSeeder); // Then result.ShouldContainEntities(expected); }
public async Task Navigational_Property(string query, int[] expected) { // Given, When var result = await TestQueryRunner.Execute(query, DefaultSeeder); // Then result.ShouldContainEntities(expected); }
public async Task Nullable_Decimal(string query, int[] expected) { // Given, When var result = await TestQueryRunner.Execute(query, DefaultSeeder); // Then result.ShouldContainEntities(expected); }
public async Task Should_Throw_If_Decimal_Has_Invalid_Format(string query) { // Given, When var result = await Record.ExceptionAsync( () => TestQueryRunner.Execute(query, DefaultSeeder)); // Then result .ShouldBeOfType <InvalidOperationException>() .And().Message.ShouldBe("Invalid number format."); }
public async Task Should_Throw_If_Trying_To_Map_Non_Entity_Type_Property() { // Given, When var result = await Record.ExceptionAsync(async() => { await TestQueryRunner.Execute("Foo = 'Contoso'", DefaultSeeder, options => { options.Configure <Document>(document => { document.Map <Invoice>(invoice => { invoice.Map("Foo", e => e.Dummy); }); }); }); }); // Then result .ShouldBeOfType <InvalidOperationException>() .And().Message.ShouldBe("The property 'Invoice.Dummy' is not mapped to an entity."); }
public async Task Should_Throw_If_Trying_To_Map_Navigational_Property_Directly() { // Given, When var result = await Record.ExceptionAsync(async() => { await TestQueryRunner.Execute("Foo = 'Contoso'", DefaultSeeder, options => { options.Configure <Document>(document => { document.Map <Invoice>(invoice => { invoice.Map("Foo", e => e.Company); }); }); }); }); // Then result .ShouldBeOfType <InvalidOperationException>() .And().Message.ShouldBe("Cannot map the navigational property 'Company' directly."); }
public async Task Should_Throw_If_Trying_To_Map_Inherited_Parameter_With_Already_Existing_Name() { // Given, When var result = await Record.ExceptionAsync(async() => { await TestQueryRunner.Execute("Foo = 1", DefaultSeeder, options => { options.Configure <Document>(document => { document.Map("Foo", e => e.DocumentId); document.Map <Invoice>(invoice => { invoice.Map("Foo", e => e.Cancelled); }); }); }); }); // Then result .ShouldBeOfType <InvalidOperationException>() .And().Message.ShouldBe("The property 'Foo' have been defined twice."); }