public void Apply_should_assign_reference_arguments()
        {
            // Arrange
            var wrapped = new TypeThatImplementsInterfaceWithOutputAndRefArguments
            {
                ReferenceArgumentThatWillBeApplied = 10
            };

            var call = FakeCall.Create<ITypeWithOutputAndRefArguments>("MethodWithReferenceArgument", new[] { Type.GetType("System.Int32&") }, new object[] { 0 });
            var rule = this.CreateRule(wrapped);

            // Act
            rule.Apply(call);

            // Assert
            call.Arguments[0].Should().Be(10);
        }
예제 #2
0
        public void Apply_should_assign_out_arguments()
        {
            // Arrange
            var wrapped = new TypeThatImplementsInterfaceWithOutputAndRefArguments()
            {
                OutArgumentThatWillBeApplied = 10
            };

            var call = FakeCall.Create <ITypeWithOutputAndRefArguments>("MethodWithOutputArgument", new[] { Type.GetType("System.Int32&") }, new object[] { 0 });
            var rule = this.CreateRule(wrapped);

            // Act
            rule.Apply(call);

            // Assert
            Assert.That(call.Arguments[0], Is.EqualTo(10));
        }