public void MockObjCanHandleGetEventSubscribersCallsWithoutEventsRegistered() { WithParameters withParameters = MockRepository.GenerateStrictMock <WithParameters>(1); IMockedObject mocked = (IMockedObject)withParameters; Delegate eventSubscribers = mocked.GetEventSubscribers("ff"); Assert.Null(eventSubscribers); }
public void CanMockWithCtorParams() { WithParameters withParameters = mocks.PartialMock <WithParameters>(1); Expect.Call(withParameters.Int).Return(4); mocks.ReplayAll(); Assert.Equal(4, withParameters.Int); mocks.VerifyAll(); }
public void CanMockWithCtorParams() { WithParameters withParameters = MockRepository.Partial <WithParameters>(1); withParameters.Expect(x => x.Int) .Return(4); Assert.Equal(4, withParameters.Int); withParameters.VerifyAllExpectations(); }
public void CanMockWithCtorParams() { WithParameters withParameters = MockRepository.Partial <WithParameters>(1); withParameters.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault); withParameters.Expect(x => x.Int) .Return(4); Assert.Equal(4, withParameters.Int); withParameters.VerifyAllExpectations(); }
public void UsingCallOriginalWithSetter() { WithParameters withParameters = MockRepository.GenerateStrictMock <WithParameters>(1); withParameters.Expect(x => x.Int = 5) .PropertyBehavior(); withParameters.Int = 12; withParameters.Int = 15; Assert.Equal(15, withParameters.Int); withParameters.VerifyAllExpectations(); }
public void UsingCallOriginalWithSetter() { MockRepository mocks = new MockRepository(); WithParameters withParameters = mocks.StrictMock <WithParameters>(1); withParameters.Int = 5; LastCall.PropertyBehavior(); mocks.ReplayAll(); withParameters.Int = 12; withParameters.Int = 15; Assert.Equal(15, withParameters.Int); mocks.VerifyAll(); }