コード例 #1
0
        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);
        }
コード例 #2
0
        public void ShouldBeAbleToUseWithConstructor()
        {
            Func <MyClass> factory = () => new MyClass();

            objectBuilder.WithFactory(factory).Returns(objectBuilder);

            SingleObjectBuilderExtensions.WithFactory(objectBuilder, factory);
        }
コード例 #3
0
        public void ShouldBeAbleToAddMultiFunction()
        {
            using (mocks.Record())
                objectBuilder.Expect(x => x.DoForAll(actionForAll, actionList)).Return(objectBuilder);

            using (mocks.Playback())
                SingleObjectBuilderExtensions.DoForAll(objectBuilder, actionForAll, actionList);
        }
コード例 #4
0
        public void ShouldBeAbleToUseAndToCallFunction()
        {
            using (mocks.Record())
                objectBuilder.Expect(x => x.Do(action)).Return(objectBuilder);

            using (mocks.Playback())
                SingleObjectBuilderExtensions.And(objectBuilder, action);
        }
コード例 #5
0
        public void ShouldBeAbleToUseAnd()
        {
            using (mocks.Record())
                objectBuilder.Expect(x => x.With(func)).Return(objectBuilder);

            using (mocks.Playback())
                SingleObjectBuilderExtensions.And(objectBuilder, func);
        }
コード例 #6
0
        public void ShouldBeAbleToUseWithConstructor()
        {
            Expression <Func <MyClass> > constructor = () => new MyClass();

            objectBuilder.WithConstructor(constructor).Returns(objectBuilder);

            SingleObjectBuilderExtensions.WithConstructor(objectBuilder, constructor);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        public void ShouldBeAbleToUseWithToSetPrivateProperties()
        {
            objectBuilder.Do(new Action <MyClass>(a => a.StringOne = "")).Returns(objectBuilder);

            SingleObjectBuilderExtensions.With(objectBuilder, propertyExpression, 100);
        }
コード例 #9
0
        public void ShouldBeAbleToAddMultiFunction()
        {
            objectBuilder.DoForAll(actionForAll, actionList).Returns(objectBuilder);

            SingleObjectBuilderExtensions.DoForAll(objectBuilder, actionForAll, actionList);
        }
コード例 #10
0
        public void ShouldBeAbleToUseAndToCallFunction()
        {
            objectBuilder.Do(action).Returns(objectBuilder);

            SingleObjectBuilderExtensions.And(objectBuilder, action);
        }
コード例 #11
0
        public void ShouldBeAbleToUseAnd()
        {
            objectBuilder.With(func).Returns(objectBuilder);

            SingleObjectBuilderExtensions.And(objectBuilder, func);
        }