示例#1
0
        private static void Main(string[] args)
        {
            ActorSystem system = ActorSystem.Create(ActorPaths.SystemName);

            Console.CancelKeyPress += (sender, eventArgs) =>
            {
                eventArgs.Cancel = true;
                system.Terminate();
            };

            IActorRef consoleWriterActor = system.ActorOf(
                ConsoleWriter.Props(),
                ActorPaths.ConsoleWriter.Name);

            IActorRef validatorActor = system.ActorOf(
                ConsoleValidator.Props(consoleWriterActor),
                ActorPaths.ConsoleValidator.Name);

            IActorRef consoleReaderActor = system.ActorOf(
                ConsoleReader.Props(validatorActor),
                ActorPaths.ConsoleReader.Name);

            consoleReaderActor.Tell(new StartMessage());

            system.WhenTerminated.Wait();
        }
示例#2
0
        public void Subtract_SimpleValueShouldCalculate(double x, double y, double expected)
        {
            // Arrange

            // Act
            double actual = ConsoleValidator.Subtract(x, y);

            // Assert
            Assert.Equal(expected, actual);
        }