예제 #1
0
        public void Initialize()
        {
            _personenautoWaMiniCasco = CreatePersonenautoWaMiniCasco();

            _agentMock = new Mock <IRollsAgent>(MockBehavior.Strict);
            _agentMock.Setup(f => f.BerekenPremiePersonenAutoWAMiniCasco(It.IsAny <string>(), It.IsAny <DateTime>(),
                                                                         It.IsAny <string>()))
            .Returns(
                _personenautoWaMiniCasco
                );

            _sut = new RollsController(_agentMock.Object);
        }
예제 #2
0
        static void Main(string[] args)
        {
            CalculatorController calculatorService = new CalculatorController();
            PresenterController  presenterService  = new PresenterController();
            RollsController      rollsService      = new RollsController();

            int[] rolls = new int[21];
            for (int i = 0; i < 21; i++)
            {
                rolls[i] = 0;
            }
            rollsService.Post(rolls);
            int[] scores = calculatorService.Scores;
            Console.WriteLine("Score: " + scores[9]);
        }
예제 #3
0
        private static void Main()
        {
            try
            {
                var agent      = new RollsAgent();
                var controller = new RollsController(agent);

                ServiceRuntime.RegisterServiceAsync("RollsServiceType",
                                                    context => new RollsServiceEndpoint(context, controller)).GetAwaiter().GetResult();

                ServiceEventSource.Current.ServiceTypeRegistered(Process.GetCurrentProcess().Id, typeof(RollsServiceEndpoint).Name);

                Thread.Sleep(Timeout.Infinite);
            }
            catch (Exception e)
            {
                ServiceEventSource.Current.ServiceHostInitializationFailed(e.ToString());
                throw;
            }
        }
예제 #4
0
 public void Initialize()
 {
     calculatorService = new CalculatorController();
     presenterService  = new PresenterController();
     rollsService      = new RollsController();
 }