예제 #1
0
파일: Main.cs 프로젝트: itwymt/Kata5
 private static void Main(string[] args)
 {
     var publisher = new Publisher();
     var subsriberCreator = new SubscriberCreator(publisher);
     var commandProcessor = new CommandProcessor(publisher, subsriberCreator, Console.In);
     commandProcessor.SubscribeAndReadText();
     Console.ReadLine();
 }
예제 #2
0
파일: Tests.cs 프로젝트: itwymt/Kata5
 public void test_add_subscriber_command()
 {
     var publisher = Substitute.For<IPublisher>();
     var sc = Substitute.For<ISubscriberCreator>();
     var st = new StringReader("add");
     var cp = new CommandProcessor(publisher,sc,st);
     cp.SubscribeAndReadText();
     sc.Received().CreateSubscriber(Arg.Any<TextWriter>());
 }
예제 #3
0
        private static void Main(string[] args)
        {
            var publisher        = new Publisher();
            var subsriberCreator = new SubscriberCreator(publisher);
            var commandProcessor = new CommandProcessor(publisher, subsriberCreator, Console.In);

            commandProcessor.SubscribeAndReadText();
            Console.ReadLine();
        }
예제 #4
0
파일: Tests.cs 프로젝트: itwymt/Kata5
 public void test_reading_text()
 {
     var publisher = Substitute.For<IPublisher>();
     var sc = Substitute.For<ISubscriberCreator>();
     var sr = new StringReader("some text");
     var cp = new CommandProcessor(publisher, sc, sr);
     cp.SubscribeAndReadText();
     publisher.Received().Publish("some text");
     publisher.DidNotReceive().Publish("some other text");
 }
예제 #5
0
        public void test_add_subscriber_command()
        {
            var publisher = Substitute.For <IPublisher>();
            var sc        = Substitute.For <ISubscriberCreator>();
            var st        = new StringReader("add");
            var cp        = new CommandProcessor(publisher, sc, st);

            cp.SubscribeAndReadText();
            sc.Received().CreateSubscriber(Arg.Any <TextWriter>());
        }
예제 #6
0
        public void test_reading_text()
        {
            var publisher = Substitute.For <IPublisher>();
            var sc        = Substitute.For <ISubscriberCreator>();
            var sr        = new StringReader("some text");
            var cp        = new CommandProcessor(publisher, sc, sr);

            cp.SubscribeAndReadText();
            publisher.Received().Publish("some text");
            publisher.DidNotReceive().Publish("some other text");
        }