コード例 #1
0
        public void CkCLOnEmptySystem()
        {
            // Arrange
            var source = scheduler.CreateColdObservable(
                OnNext(010, (MessageBuilder.Default
                             + "CK,APP,103-1"
                             + "CL,APP,105")
                       .BuildMessage(4711, nameof(CkCLOnEmptySystem))),
                OnCompleted <Message>(020)
                );

            var _ = new MessageBusInteractor(CreateLockSystem(), CreateLoggerFactory(), this.target, source);

            // Act
            var messageObserver = this.scheduler.Start(() => source, 0, 0, TimeSpan.FromSeconds(5).Ticks);

            // Assert
            var expected = (MessageBuilder.Default
                            + "DK,040000jbookls,,,,"
                            + "DL,040000rbookls,,,,")
                           .BuildStatement(4711, nameof(CkCLOnEmptySystem));

            ReactiveAssert.AreElementsEqual(
                new Recorded <Notification <Statement> >[] {
                OnNext(010, expected),
                OnCompleted <Statement>(010)
            },
                this.target.Messages);
        }
コード例 #2
0
ファイル: Startup.cs プロジェクト: JochenKoertner/LockbaseELI
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env,
                              BrowserChannel browserChannel, MessageBusInteractor messageBusInteractor)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
            }

            app.UseCors(MyAllowSpecificOrigins);

            app.UseStaticFiles();
            app.UseSpaStaticFiles();
            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapHub <SignalrHub>("/signalr");
                endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
            });

            app.UseSpa(spa =>
            {
                if (env.IsDevelopment())
                {
                    spa.Options.SourcePath = "../../frontend";
                    spa.UseProxyToSpaDevelopmentServer("http://localhost:3000");
                    //spa.UseReactDevelopmentServer(npmScript: "start");
                }
            });

            // Open the Electron-Window here
            // Task.Run(async () => await Electron.WindowManager.CreateWindowAsync(
            //  new BrowserWindowOptions
            //  {
            //      Width = 1260,
            //      Height = 1200,
            //  }));
        }
コード例 #3
0
        public void ATAKOnSystem()
        {
            // Arrange
            var lockSystem = CreateLockSystem();

            lockSystem.SetValue(sys => sys
                                .DefineStatement("CK,APP,103-1")
                                .DefineStatement("CL,APP,105")
                                .DefineStatement($"DK,040000jbookls,,,{"103-1, Fender, Klaus\0".ToBase64()}")
                                .DefineStatement($"DL,040000rbookls,,,{"105, Büro Vertrieb 2\0".ToBase64()}")
                                );

            var source = scheduler.CreateColdObservable(
                OnNext(010, (MessageBuilder.Default
                             + $"AT,000002oe1g25o,,20190212T080000Z/28800/DW(Mo+Tu+We+Th+Fr)/20190329T160000Z,20190401T070000Z/28800/DW(Mo+Tu+We+Th+Fr)/20191025T150000Z,20191028T080000Z/28800/DW(Mo+Tu+We+Th+Fr)/20200211T160000Z"
                             + $"AK,040000jbookls,000002oe1g25o,040000rbookls")
                       .BuildMessage(4711, nameof(ATAKOnSystem))
                       ),
                OnCompleted <Message>(020)
                );

            var _ = new MessageBusInteractor(lockSystem, CreateLoggerFactory(), this.target, source);

            // Act
            var messageObserver = this.scheduler.Start(() => source, 0, 0, TimeSpan.FromSeconds(5).Ticks);

            // Assert
            var expected = (MessageBuilder.Default
                            + "ATR,000002oe1g25o,OK"
                            + "AKR,040000jbookls,OK")
                           .BuildStatement(4711, nameof(ATAKOnSystem));

            ReactiveAssert.AreElementsEqual(
                new Recorded <Notification <Statement> >[] {
                OnNext(010, expected),
                OnCompleted <Statement>(010)
            },
                this.target.Messages);
        }
コード例 #4
0
        public void DKDLOnSystem()
        {
            // Arrange
            var lockSystem = CreateLockSystem();

            lockSystem.SetValue(sys => sys
                                .DefineStatement("CK,APP,103-1")
                                .DefineStatement("CL,APP,105"));

            var source = scheduler.CreateColdObservable(
                OnNext(010, (MessageBuilder.Default
                             + $"DK,040000jbookls,,,{"103-1, Fender, Klaus\0".ToBase64()}"
                             + $"DL,040000rbookls,,,{"105, Büro Vertrieb 2\0".ToBase64()}")
                       .BuildMessage(4711, nameof(DKDLOnSystem))
                       ),
                OnCompleted <Message>(020)
                );

            var _ = new MessageBusInteractor(lockSystem, CreateLoggerFactory(), this.target, source);

            // Act
            var messageObserver = this.scheduler.Start(() => source, 0, 0, TimeSpan.FromSeconds(5).Ticks);

            // Assert
            var expected = (MessageBuilder.Default
                            + $"DK,040000jbookls,,,,{"103-1, Fender, Klaus\0".ToBase64()}"
                            + $"DL,040000rbookls,,,,{"105, Büro Vertrieb 2\0".ToBase64()}")
                           .BuildStatement(4711, nameof(DKDLOnSystem));

            ReactiveAssert.AreElementsEqual(
                new Recorded <Notification <Statement> >[] {
                OnNext(010, expected),
                OnCompleted <Statement>(010)
            },
                this.target.Messages);
        }