Exemple #1
0
 public Startup(IConfiguration configuration)
 {
     Configuration = configuration;
     StaticConfig  = configuration;
     logger        = new GraphLogger(typeof(Startup).Assembly.GetName().Name);
     observer      = new SampleObserver(logger);
     DocumentDBRepository.Initialize();
 }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HueBot" /> class.
        /// </summary>
        /// <param name="context">Stateless service context from service fabric.</param>
        /// <param name="logger">Global logger instance.</param>
        /// <param name="observer">Global observer instance.</param>
        public HueBot(StatelessServiceContext context, IGraphLogger logger, SampleObserver observer)
            : base(context)
        {
            this.logger   = logger;
            this.observer = observer;

            // Set directory to where the assemblies are running from.
            // This is necessary for Media binaries to pick up logging configuration.
            var location = Assembly.GetExecutingAssembly().Location;

            Directory.SetCurrentDirectory(Path.GetDirectoryName(location));
        }
Exemple #3
0
        public void 自作Subjectテスト()
        {
            var mySubject      = new MySubject <int>();
            var sampleObserver = new SampleObserver();

            var disposable = mySubject.Subscribe(sampleObserver);

            mySubject.OnNext(1);

            Assert.AreEqual(1, sampleObserver.Value, "受け取れてること");

            // 破棄
            disposable.Dispose();

            mySubject.OnNext(2);

            Assert.AreEqual(1, sampleObserver.Value, "破棄しているので更新されない");

            mySubject.OnCompleted();
            mySubject.Dispose();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="HomeController"/> class.
 /// </summary>
 /// <param name="observer">The observer.</param>
 public HomeController(SampleObserver observer)
 {
     this.observer = observer;
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DemoController" /> class.
 /// </summary>
 /// <param name="bot">Bot instance.</param>
 /// <param name="logger">Logger instance.</param>
 /// <param name="observer">The observer.</param>
 public DemoController(Bot bot, IGraphLogger logger, SampleObserver observer)
 {
     this.bot      = bot;
     this.logger   = logger;
     this.observer = observer;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="IncidentsController" /> class.
 /// </summary>
 /// <param name="bot">The bot.</param>
 /// <param name="observer">The log observer.</param>
 public IncidentsController(Bot bot, SampleObserver observer)
 {
     this.bot      = bot;
     this.observer = observer;
 }
Exemple #7
0
 public Startup(IConfiguration configuration)
 {
     this.Configuration = configuration;
     this.logger        = new GraphLogger(typeof(Startup).Assembly.GetName().Name);
     this.observer      = new SampleObserver(this.logger);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ParticipantsCallingController" /> class.
 /// </summary>
 /// <param name="bot">The bot.</param>
 public ParticipantsCallingController(Bot bot, SampleObserver observer)
 {
     this.bot = bot;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClassesController" /> class.
 /// </summary>
 /// <param name="bot">The bot.</param>
 /// <param name="observer">The log observer.</param>
 public ClassesController(Bot bot, SampleObserver observer)
 {
     this.bot      = bot;
     this.observer = observer;
 }