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 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.º 3
0
 public void NullDeleter_Ctor_Throws()
 {
     IItemRepository repo     = new MockItemRepository();
     IRecordDeleter  deleter  = null;
     var             workflow = new BarWorkflow(repo, deleter);
 }