コード例 #1
0
		public void StubInterface_CanReadWriteProperties()
		{
			ITestNormal test = MockRepository.Mock<ITestNormal>();

			test.Foo = 10;
			Assert.Equal(10, test.Foo);

            test.VerifyExpectations();
		}
コード例 #2
0
        public void StubInterface_CanReadWriteProperties()
        {
            ITestNormal test = MockRepository.Mock <ITestNormal>();

            test.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault);

            test.Foo = 10;
            Assert.Equal(10, test.Foo);

            test.VerifyExpectations();
        }
コード例 #3
0
		public void MockNormalInterface_CanSetProperties()
		{
			ITestNormal test = MockRepository.Mock<ITestNormal>();

            test.ExpectProperty(x => x.Foo);

			test.Foo = 10;
			Assert.Equal(10, test.Foo);

            test.VerifyExpectations();
		}
コード例 #4
0
        public void StubInterface_CanReadWriteProperties()
        {
            MockRepository mocks = new MockRepository();
            ITestNormal    test  = mocks.Stub <ITestNormal>();

            mocks.ReplayAll();

            test.Foo = 10;
            Assert.Equal(10, test.Foo);

            mocks.VerifyAll();
        }
コード例 #5
0
        public void MockNormalInterface_CanSetProperties()
        {
            MockRepository mocks = new MockRepository();
            ITestNormal    test  = mocks.StrictMock <ITestNormal>();

            SetupResult.For(test.Foo).PropertyBehavior();

            mocks.ReplayAll();

            test.Foo = 10;
            Assert.Equal(10, test.Foo);

            mocks.VerifyAll();
        }