public void ShouldBeAbleToUseAnd() { using (mocks.Record()) { operable.Expect(x => x.ObjectBuilder).Return(new ObjectBuilder <MyClass>(null)); objectBuilder.Expect(x => x.With(func)); } OperableExtensions.And((IOperable <MyClass>)operable, func); }
public void ShouldBeAbleToUseAndToSetPrivateProperties() { using (mocks.Record()) { operable.Expect(x => x.ObjectBuilder).Return(new ObjectBuilder <MyClass>(null)); objectBuilder.Expect(x => x.With(propertyExpression, 100)); } OperableExtensions.And((IOperable <MyClass>)operable, propertyExpression, 100); }
public void ShouldBeAbleToUseAndToSetPrivateProperties() { var builderSetup = new BuilderSettings(); { operable.ObjectBuilder.Returns(new ObjectBuilder <MyClass>(null, builderSetup)); objectBuilder.With(propertyExpression, 100); } OperableExtensions.And((IOperable <MyClass>)operable, propertyExpression, 100); }
public void ShouldBeAbleToUseAnd() { var builderSetup = new BuilderSettings(); { operable.ObjectBuilder.Returns(new ObjectBuilder <MyClass>(null, builderSetup)); objectBuilder.With(func); } OperableExtensions.And((IOperable <MyClass>)operable, func); }
public void ShouldBeAbleToUseAndToAddAnAction() { Action <MyClass> action = x => x.DoSomething(); using (mocks.Record()) { operable.Expect(x => x.ObjectBuilder).Return(objectBuilder); objectBuilder.Expect(x => x.Do(action)).Return(objectBuilder); } OperableExtensions.And((IOperable <MyClass>)operable, action); }
public void ShouldBeAbleToUseAndToAddAnAction() { Action <MyClass> action = x => x.DoSomething(); { operable.ObjectBuilder.Returns(objectBuilder); objectBuilder.Do(action).Returns(objectBuilder); } OperableExtensions.And((IOperable <MyClass>)operable, action); }
public void ShouldBeAbleToUseAndWithAnIndex() { var builderSetup = new BuilderSettings(); Action <MyClass, int> funcWithIndex = (x, idx) => x.StringOne = "String" + (idx + 5); { operable.ObjectBuilder.Returns(new ObjectBuilder <MyClass>(null, builderSetup)); objectBuilder.With(funcWithIndex); } OperableExtensions.And((IOperable <MyClass>)operable, funcWithIndex); }
public void ShouldBeAbleToUseAndWithAnIndex() { Action <MyClass, int> funcWithIndex = (x, idx) => x.StringOne = "String" + (idx + 5); using (mocks.Record()) { operable.Expect(x => x.ObjectBuilder).Return(new ObjectBuilder <MyClass>(null)); objectBuilder.Expect(x => x.With(funcWithIndex)); } OperableExtensions.And((IOperable <MyClass>)operable, funcWithIndex); }