public void Incorrect_Method__Throws_MethodNameException() { // Arrange var fluent = Create(); fluent.Maximum(Rnd.ULng); // Act var action = (ICall c) => FluentQueryHelper.AssertWhereIn <TestEntity, long>(c, x => x.Bar, new[] { Rnd.Lng, Rnd.Lng }); // Assert Assert.Throws <MethodNameException>(() => fluent.AssertCalls(action)); }
public void Values_Not_Equal__Throws_EqualTypeException() { // Arrange var fluent = Create(); var values = new[] { Rnd.Str, Rnd.Str }; fluent.WhereIn(x => x.Foo, values); // Act var action = (ICall c) => FluentQueryHelper.AssertWhereIn <TestEntity, string>(c, x => x.Foo, new[] { Rnd.Str, Rnd.Str }); // Assert Assert.Throws <EqualTypeException>(() => fluent.AssertCalls(action)); }
public void Incorrect_Generic_Argument__Throws_GenericArgumentException() { // Arrange var fluent = Create(); var values = new[] { Rnd.Str, Rnd.Str }; fluent.WhereIn(x => x.Foo, values); // Act var action = (ICall c) => FluentQueryHelper.AssertWhereIn <TestEntity, long>(c, x => x.Bar, new[] { Rnd.Lng, Rnd.Lng }); // Assert Assert.Throws <GenericArgumentException>(() => fluent.AssertCalls(action)); }
public void Asserts_WhereIn() { // Arrange var fluent = Create(); var values = new[] { Rnd.Str, Rnd.Str }; fluent.WhereIn(x => x.Foo, values); // Act var action = (ICall c) => FluentQueryHelper.AssertWhereIn <TestEntity, string>(c, x => x.Foo, values); // Assert fluent.AssertCalls(action); }