public void ShouldBeAbleToUseWithToSetPrivateProperties() { using (mocks.Record()) objectBuilder.Expect(x => x.Do(new Action <MyClass>(a => a.StringOne = ""))).IgnoreArguments().Return(objectBuilder); using (mocks.Playback()) SingleObjectBuilderExtensions.With(objectBuilder, propertyExpression, 100); }
public void ShouldBeAbleToUseWithConstructor() { Func <MyClass> factory = () => new MyClass(); objectBuilder.WithFactory(factory).Returns(objectBuilder); SingleObjectBuilderExtensions.WithFactory(objectBuilder, factory); }
public void ShouldBeAbleToAddMultiFunction() { using (mocks.Record()) objectBuilder.Expect(x => x.DoForAll(actionForAll, actionList)).Return(objectBuilder); using (mocks.Playback()) SingleObjectBuilderExtensions.DoForAll(objectBuilder, actionForAll, actionList); }
public void ShouldBeAbleToUseAndToCallFunction() { using (mocks.Record()) objectBuilder.Expect(x => x.Do(action)).Return(objectBuilder); using (mocks.Playback()) SingleObjectBuilderExtensions.And(objectBuilder, action); }
public void ShouldBeAbleToUseAnd() { using (mocks.Record()) objectBuilder.Expect(x => x.With(func)).Return(objectBuilder); using (mocks.Playback()) SingleObjectBuilderExtensions.And(objectBuilder, func); }
public void ShouldBeAbleToUseWithConstructor() { Expression <Func <MyClass> > constructor = () => new MyClass(); objectBuilder.WithConstructor(constructor).Returns(objectBuilder); SingleObjectBuilderExtensions.WithConstructor(objectBuilder, constructor); }
public void ShouldBeAbleToUseWithConstructor() { Expression <Func <MyClass> > constructor = () => new MyClass(); using (mocks.Record()) objectBuilder.Expect(x => x.WithConstructor(constructor)).Return(objectBuilder); using (mocks.Playback()) SingleObjectBuilderExtensions.WithConstructor(objectBuilder, constructor); }
public void ShouldBeAbleToUseWithToSetPrivateProperties() { objectBuilder.Do(new Action <MyClass>(a => a.StringOne = "")).Returns(objectBuilder); SingleObjectBuilderExtensions.With(objectBuilder, propertyExpression, 100); }
public void ShouldBeAbleToAddMultiFunction() { objectBuilder.DoForAll(actionForAll, actionList).Returns(objectBuilder); SingleObjectBuilderExtensions.DoForAll(objectBuilder, actionForAll, actionList); }
public void ShouldBeAbleToUseAndToCallFunction() { objectBuilder.Do(action).Returns(objectBuilder); SingleObjectBuilderExtensions.And(objectBuilder, action); }
public void ShouldBeAbleToUseAnd() { objectBuilder.With(func).Returns(objectBuilder); SingleObjectBuilderExtensions.And(objectBuilder, func); }