Exemplo n.º 1
0
        public void Create_ReturnsWorkflow()
        {
            IItemRepository repo = new MockItemRepository();
            IRecordDeleter deleter = new MockRecordDeleter();
            var factory = new BarWorkflowFactory(repo, deleter);

            BarWorkflow workflow = factory.Create();
            Assert.IsNotNull(workflow);
        }
Exemplo n.º 2
0
        public void Create_ReturnsWorkflow()
        {
            IItemRepository repo    = new MockItemRepository();
            IRecordDeleter  deleter = new MockRecordDeleter();
            var             factory = new BarWorkflowFactory(repo, deleter);

            BarWorkflow workflow = factory.Create();

            Assert.IsNotNull(workflow);
        }
Exemplo n.º 3
0
        public void AllValid_Run_Success()
        {
            //I don't know what a proper set of unit tests would be for a given workflow, other than that it should exercise all code paths
            //and confirm that all specifications are met. This is just an example.
            var repo     = new MockItemRepository();
            var deleter  = new MockRecordDeleter();
            var workflow = new BarWorkflow(repo, deleter);

            workflow.Run();

            Assert.AreEqual(1, repo.TimesRun);
            Assert.AreEqual(2, deleter.GetDeletedBars().Count());
        }
Exemplo n.º 4
0
        public void AllValid_Run_Success()
        {
            //I don't know what a proper set of unit tests would be for a given workflow, other than that it should exercise all code paths
            //and confirm that all specifications are met. This is just an example.
            var repo = new MockItemRepository();
            var deleter = new MockRecordDeleter();
            var workflow = new BarWorkflow(repo, deleter);

            workflow.Run();

            Assert.AreEqual(1, repo.TimesRun);
            Assert.AreEqual(2, deleter.GetDeletedBars().Count());
        }
Exemplo n.º 5
0
 public void NullRepo_Ctor_Throws()
 {
     IItemRepository repo     = null;
     IRecordDeleter  deleter  = new MockRecordDeleter();
     var             workflow = new BarWorkflow(repo, deleter);
 }
Exemplo n.º 6
0
 public void NullRepo_Ctor_Throws()
 {
     IItemRepository repo = null;
     IRecordDeleter deleter = new MockRecordDeleter();
     var factory = new BarWorkflowFactory(repo, deleter);
 }