Beispiel #1
0
    public void Incorrect_Method__Throws_MethodNameException()
    {
        // Arrange
        var fluent = Create();

        fluent.Maximum(Rnd.ULng);

        // Act
        var action = (ICall c) => FluentQueryHelper.AssertWhereNotIn <TestEntity, long>(c, x => x.Bar, new[] { Rnd.Lng, Rnd.Lng });

        // Assert
        Assert.Throws <MethodNameException>(() => fluent.AssertCalls(action));
    }
Beispiel #2
0
    public void Values_Not_Equal__Throws_EqualTypeException()
    {
        // Arrange
        var fluent = Create();
        var values = new[] { Rnd.Str, Rnd.Str };

        fluent.WhereNotIn(x => x.Foo, values);

        // Act
        var action = (ICall c) => FluentQueryHelper.AssertWhereNotIn <TestEntity, string>(c, x => x.Foo, new[] { Rnd.Str, Rnd.Str });

        // Assert
        Assert.Throws <EqualTypeException>(() => fluent.AssertCalls(action));
    }
Beispiel #3
0
    public void Incorrect_Generic_Argument__Throws_GenericArgumentException()
    {
        // Arrange
        var fluent = Create();
        var values = new[] { Rnd.Str, Rnd.Str };

        fluent.WhereNotIn(x => x.Foo, values);

        // Act
        var action = (ICall c) => FluentQueryHelper.AssertWhereNotIn <TestEntity, long>(c, x => x.Bar, new[] { Rnd.Lng, Rnd.Lng });

        // Assert
        Assert.Throws <GenericArgumentException>(() => fluent.AssertCalls(action));
    }
Beispiel #4
0
    public void Asserts_WhereNotIn()
    {
        // Arrange
        var fluent = Create();
        var values = new[] { Rnd.Str, Rnd.Str };

        fluent.WhereNotIn(x => x.Foo, values);

        // Act
        var action = (ICall c) => FluentQueryHelper.AssertWhereNotIn <TestEntity, string>(c, x => x.Foo, values);

        // Assert
        fluent.AssertCalls(action);
    }