public void WhenNotCalled ()
		{
			IModelRepository mock = MockRepository.GenerateMock<IModelRepository> ();

			var modelCreator = new ModelCreator (mock);
			var theModel = new AnotherModel () { FieldA = 1, FieldB = "Test" };

			modelCreator.CreateModel (theModel);

			mock.AssertWasNotCalled (p => p.Add (Arg<AnotherModel>.Is.Null));       
		}
		public void WhenArgumentIsAnything ()
		{
			IModelRepository mock = MockRepository.GenerateMock<IModelRepository> ();

			var modelCreator = new ModelCreator (mock);
			var theModel = new AnotherModel () { FieldA = 1, FieldB = "Test" };

			mock.Expect (p => p.Add (Arg<AnotherModel>.Is.Anything));
			modelCreator.CreateModel (theModel);

			mock.VerifyAllExpectations ();
		}
        public void WhenNotCalled()
        {
            IModelRepository mock = MockRepository.GenerateMock <IModelRepository> ();

            var modelCreator = new ModelCreator(mock);
            var theModel     = new AnotherModel()
            {
                FieldA = 1, FieldB = "Test"
            };

            modelCreator.CreateModel(theModel);

            mock.AssertWasNotCalled(p => p.Add(Arg <AnotherModel> .Is.Null));
        }
Example #4
0
        public void WhenArgumentIsAnything()
        {
            IModelRepository mock = MockRepository.GenerateMock <IModelRepository> ();

            var modelCreator = new ModelCreator(mock);
            var theModel     = new AnotherModel()
            {
                FieldA = 1, FieldB = "Test"
            };

            mock.Expect(p => p.Add(Arg <AnotherModel> .Is.Anything));
            modelCreator.CreateModel(theModel);

            mock.VerifyAllExpectations();
        }
 public void Remove(AnotherModel theModel)
 {
     this.ModelCount++;
 }
 public void Add(AnotherModel theModel)
 {
     this.ModelCount++;
 }
 public void RemoveModel(AnotherModel aModel)
 {
     this.repository.Remove(aModel);
 }
 public void CreateModel(AnotherModel aModel)
 {
     this.repository.Add(aModel);
 }
 public void Remove(AnotherModel theModel)
 {
     this.ModelCount++;
 }
 public void Add(AnotherModel theModel)
 {
     this.ModelCount++;
 }
Example #11
0
 public void RemoveModel(AnotherModel aModel)
 {
     this.repository.Remove(aModel);
 }
Example #12
0
 public void CreateModel(AnotherModel aModel)
 {
     this.repository.Add(aModel);
 }