Exemple #1
0
        public void CallTo_with_void_call_should_be_null_guarded()
        {
            // Arrange
            var foo = A.Fake <IFoo>();

            // Act

            // Assert
            NullGuardedConstraint.Assert(() =>
                                         this.configurationManager.CallTo(() => foo.Bar()));
        }
Exemple #2
0
        public void RemoveRule_should_be_null_guarded()
        {
            // Arrange
            var fake = this.CreateFakeObject <IFoo>();

            // Act

            // Assert
            NullGuardedConstraint.Assert(() =>
                                         fake.RemoveRule(ExpressionHelper.CreateRule <IFoo>(x => x.Bar())));
        }
 public void Generate_fake_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() => this.fakeObjectBuilder.GenerateFake <IFoo>(x => x.Wrapping(A.Fake <IFoo>())));
 }
Exemple #4
0
 public void Constructor_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  new ExpressionCallRule(this.callMatcher));
 }
Exemple #5
0
 public void CallsTo_for_void_methods_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  ES.FullExtensionSyntax.CallsTo(A.Fake <IFoo>(), x => x.Bar()));
 }
Exemple #6
0
 public void AnyCall_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  ES.FullExtensionSyntax.AnyCall(A.Fake <IFoo>()));
 }
Exemple #7
0
 public void AssertWasCalled_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  this.builder.AssertWasCalled(x => true));
 }
Exemple #8
0
 public void Constructor_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  new FakeAssertions <IFoo>(this.fake, this.callMatcherFactory, x => this.fakeAsserter));
 }
 public void Single_parameter_constructor_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() => new FakeObject(typeof(IFoo)));
 }
Exemple #10
0
 public void Constructor_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  new FakeAsserter <IFoo>(this.fake, A.Fake <ICallCollectionFactory>(), this.callMatcherFactory));
 }
Exemple #11
0
 public void AnyCall_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() => A.Fake <IFoo>().AnyCall());
 }
Exemple #12
0
 public void CallsTo_for_void_methods_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() => A.Fake <IFoo>().CallsTo(x => x.Bar()));
 }
Exemple #13
0
 public void CallsTo_for_return_value_methods_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() => "string".CallsTo(x => x.Length));
 }
 public void Fake_with_arguments_for_constructor_should_be_properly_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  this.fakeObjectBuilder.GenerateFake <IFoo>(x => x.WithArgumentsForConstructor(new object[] { "foo", 1 })));
 }
        public void Constructor_that_takes_method_is_properly_null_guarded()
        {
            var method = typeof(IFoo).GetMethod("Bar", new[] { typeof(object), typeof(object) });

            NullGuardedConstraint.Assert(() => new ArgumentCollection(new object[] { "foo", 1 }, method));
        }
 public void Create_should_be_null_guarded()
 {
     // Assert
     NullGuardedConstraint.Assert(() =>
                                  ArgumentValidator <int> .Create(this.validations, x => true, "foo"));
 }
 public void WasCalled_for_functions_with_repeat_predicate_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  this.asserter.WasCalled(x => x.Baz(), x => x > 10));
 }
 public void Two_parameters_constructor_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() => new FakeObject(typeof(string), new object[] { }));
 }
Exemple #19
0
 public void To_should_be_properly_guarded()
 {
     NullGuardedConstraint.Assert(() => ThisCall.To(A.Fake <IFoo>()));
 }
Exemple #20
0
        public void Returns_with_call_function_should_be_properly_guarded()
        {
            var config = this.CreateTestableReturnConfiguration();

            NullGuardedConstraint.Assert(() => config.Returns(x => x.Arguments.Get <int>(0)));
        }
Exemple #21
0
 public void MustHaveHappened_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  this.builder.MustHaveHappened(Repeated.AtLeast.Once));
 }
Exemple #22
0
 public void AssignsOutAndRefParameters_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  this.builder.AssignsOutAndRefParameters());
 }
Exemple #23
0
 public void WhenArgumentsMatches_from_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  this.builder.WhenArgumentsMatch(x => true));
 }
Exemple #24
0
 public void CallsTo_for_return_value_methods_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  ES.FullExtensionSyntax.CallsTo("string", x => x.Length));
 }
Exemple #25
0
 public void AssertWasCalled_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  this.configuration.AssertWasCalled(x => true));
 }
Exemple #26
0
 public void Constructor_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  new CallInterceptedEventArgs(A.Fake <IInterceptedFakeObjectCall>()));
 }
 public void Constructor_is_properly_guarded()
 {
     NullGuardedConstraint.Assert(() => new ArgumentCollection(new object[] { "foo", 1 }, new[] { "foo", "bar" }));
 }
Exemple #28
0
 public void CreateFake_should_be_null_guarded()
 {
     // Arrange, Act, Assert
     NullGuardedConstraint.Assert(() =>
                                  this.creator.CreateFake <IFoo>(x => x.Wrapping(A.Fake <IFoo>())));
 }
 public void Constructor_should_be_null_guarded()
 {
     NullGuardedConstraint.Assert(() =>
                                  new TestableProxyResult(typeof(string)));
 }