예제 #1
0
        public SubscriptionActorTests()
        {
            SubscriptionActor.CatchAllExceptions = false;

            var services = new ServiceCollection();

            StateManager = new MockActorStateManager();
            Darc         = new Mock <IRemote>(MockBehavior.Strict);
            Env          = new Mock <IHostingEnvironment>(MockBehavior.Strict);
            Reminders    = new MockReminderManager();
            services.AddSingleton(Env.Object);
            services.AddSingleton <IActorStateManager>(StateManager);
            services.AddSingleton <IReminderManager>(Reminders);
            services.AddMergePolicies();
            services.AddLogging();
            services.AddDbContext <BuildAssetRegistryContext>(
                options => { options.UseInMemoryDatabase("BuildAssetRegistry"); });
            services.AddSingleton(
                Mock.Of <IDarcRemoteFactory>(
                    f => f.CreateAsync(It.IsAny <string>(), It.IsAny <long>()) == Task.FromResult(Darc.Object)));
            Provider = services.BuildServiceProvider();
            Scope    = Provider.CreateScope();

            _context = new Lazy <BuildAssetRegistryContext>(GetContext);
        }
예제 #2
0
 public void ActorTests_SetUp()
 {
     ExpectedActorState = new Dictionary <string, object>();
     ExpectedReminders  = new Dictionary <string, MockReminderManager.Reminder>();
     StateManager       = new MockActorStateManager();
     Reminders          = new MockReminderManager();
 }
예제 #3
0
        public ActorTests()
        {
            StateManager = new MockActorStateManager();
            Reminders    = new MockReminderManager();

            Builder.RegisterInstance(StateManager).As <IActorStateManager>();
            Builder.RegisterInstance(Reminders).As <IReminderManager>();
        }
예제 #4
0
 protected ActorTests()
 {
     StateManager = new MockActorStateManager();
     Reminders    = new MockReminderManager();
 }
예제 #5
0
 protected ActorTests(ITestOutputHelper output) : base(output)
 {
     StateManager = new MockActorStateManager();
     Reminders    = new MockReminderManager();
 }