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); }
public void ActorTests_SetUp() { ExpectedActorState = new Dictionary <string, object>(); ExpectedReminders = new Dictionary <string, MockReminderManager.Reminder>(); StateManager = new MockActorStateManager(); Reminders = new MockReminderManager(); }
public ActorTests() { StateManager = new MockActorStateManager(); Reminders = new MockReminderManager(); Builder.RegisterInstance(StateManager).As <IActorStateManager>(); Builder.RegisterInstance(Reminders).As <IReminderManager>(); }
protected ActorTests() { StateManager = new MockActorStateManager(); Reminders = new MockReminderManager(); }
protected ActorTests(ITestOutputHelper output) : base(output) { StateManager = new MockActorStateManager(); Reminders = new MockReminderManager(); }