public void WhenAddingMockBehaviorToObject_ThenCanAddInterface() { object mock = new TestMock(); mock.AddBehavior(new TestMockBehavior()); Assert.Equal(1, ((IMocked)mock).Mock.Behaviors.Count); }
public void WhenAddingMockBehaviorToObject_ThenCanAddLambda() { object mock = new TestMock(); mock.AddBehavior(m => true, (m, n) => null); Assert.Equal(1, ((IMocked)mock).Mock.Behaviors.Count); }
public void WhenAddingMockBehavior_ThenCanAddInterface() { var mock = new TestMock(); mock.AddBehavior(new TestMockBehavior()); Assert.Equal(1, mock.Mock.Behaviors.Count); }
public void WhenAddingMockBehavior_ThenCanAddLambda() { var mock = new TestMock(); mock.AddBehavior(m => true, (m, n) => null); Assert.Equal(1, mock.Mock.Behaviors.Count); }
public void WhenInsertingMockBehaviorToObject_ThenCanAddLambda() { object mock = new TestMock(); mock.AddBehavior(m => true, (m, n) => null); mock.InsertBehavior(0, m => true, (m, n) => throw new NotImplementedException()); Assert.Equal(2, ((IMocked)mock).Mock.Behaviors.Count); Assert.Throws <NotImplementedException>(() => ((IMocked)mock).Mock.Behaviors[0].Invoke(null, null)); }
public void WhenInsertingMockBehaviorToObject_ThenCanAddInterface() { object mock = new TestMock(); var behavior = new TestMockBehavior(); mock.AddBehavior(m => true, (m, n) => null); mock.InsertBehavior(0, behavior); Assert.Equal(2, ((IMocked)mock).Mock.Behaviors.Count); Assert.Same(behavior, ((IMocked)mock).Mock.Behaviors[0]); }
public void WhenInsertingMockBehavior_ThenCanAddInterface() { var mock = new TestMock(); var behavior = new TestMockBehavior(); mock.AddBehavior(m => true, (m, n) => null); mock.InsertBehavior(0, behavior); Assert.Equal(2, mock.Mock.Behaviors.Count); Assert.Same(behavior, mock.Mock.Behaviors[0]); }