Пример #1
0
        public void Apply_should_assign_out_arguments()
        {
            // Arrange
            var wrapped = new TypeWithOutputArguments(10);
            var call = FakeCall.Create<ITypeWithOutputArguments>("MethodWithOutputArgument", new[] { Type.GetType("System.Int32&") }, new object[] { 0 });
            var rule = this.CreateRule(wrapped);

            // Act
            rule.Apply(call);

            // Assert
            call.Arguments[0].Should().Be(10);
        }
        public void Apply_should_assign_out_arguments()
        {
            // Arrange
            var wrapped = new TypeWithOutputArguments(10);
            var call    = FakeCall.Create <ITypeWithOutputArguments>("MethodWithOutputArgument", new[] { Type.GetType("System.Int32&") }, new object[] { 0 });
            var rule    = this.CreateRule(wrapped);

            // Act
            rule.Apply(call);

            // Assert
            call.Arguments[0].Should().Be(10);
        }
Пример #3
0
        public void Apply_should_assign_out_arguments()
        {
            // Arrange
            var wrapped = new TypeWithOutputArguments(10);
            int i       = 0;
            var call    = FakeCall.Create <ITypeWithOutputArguments>(x => x.MethodWithOutputArgument(out i));
            var rule    = this.CreateRule(wrapped);

            // Act
            rule.Apply(call);

            // Assert
            call.Arguments[0].Should().Be(10);
        }