示例#1
0
 public void NullSender_Ctor_Throws()
 {
     IItemRepository repo      = new MockItemRepository();
     IFooProcessor   processor = new StubFooProcessor();
     IFooSender      sender    = null;
     var             workflow  = new FooWorkflow(repo, processor, sender);
 }
示例#2
0
 public void NullSender_Ctor_Throws()
 {
     IItemRepository repo = new MockItemRepository();
     IFooProcessor processor = new StubFooProcessor();
     IFooSender sender = null;
     var workflow = new FooWorkflow(repo, processor, sender);
 }
示例#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 processor = new StubFooProcessor();
            var sender    = new MockFooSender();
            var workflow  = new FooWorkflow(repo, processor, sender);

            workflow.Run();

            Assert.AreEqual(1, repo.TimesRun);
            Assert.AreEqual(2, sender.GetSentFoos().Count());
        }
示例#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 processor = new StubFooProcessor();
            var sender = new MockFooSender();
            var workflow = new FooWorkflow(repo, processor, sender);

            workflow.Run();

            Assert.AreEqual(1, repo.TimesRun);
            Assert.AreEqual(2, sender.GetSentFoos().Count());
        }