コード例 #1
0
ファイル: AssemblyInitialize.cs プロジェクト: zhrjin/microdot
    public void SetUp()
    {
        try
        {
            Environment.SetEnvironmentVariable("GIGYA_CONFIG_ROOT", AppDomain.CurrentDomain.BaseDirectory, EnvironmentVariableTarget.Process);
            Environment.SetEnvironmentVariable("REGION", "us1", EnvironmentVariableTarget.Process);
            Environment.SetEnvironmentVariable("ZONE", "us1a", EnvironmentVariableTarget.Process);
            Environment.SetEnvironmentVariable("ENV", "_Test", EnvironmentVariableTarget.Process);

            kernel = new TestingKernel <ConsoleLog>((kernel) =>
            {
                var revokingManager = new FakeRevokingManager();
                kernel.Rebind <IRevokeListener>().ToConstant(revokingManager);
                kernel.Rebind <ICacheRevoker>().ToConstant(revokingManager);
                kernel.Rebind <IMetricsInitializer>().To <MetricsInitializerFake>();
                kernel.Rebind <IEventPublisher>().To <SpyEventPublisher>().InSingletonScope();
            });
            ResolutionRoot = kernel;
        }
        catch (Exception ex)
        {
            Console.Write(ex);
            throw;
        }
    }
コード例 #2
0
        public void RevokeNotifier_On_Revoke_Event_Should_Be_Invoked()
        {
            //Arrange
            var rm             = new FakeRevokingManager();
            var key            = "key";
            var revokeNotifier = new ServiceProxy.Caching.RevokeNotifier.RevokeNotifier(
                subLog,
                rm,
                subFuncRevokeKeyIndexer,
                subFuncRevokeNotifierConfig);

            //Act
            rm.Revoke(key);

            SpinForSeconds(2);

            //Asert
            subRevokeKeyIndexer.Received(1).GetLiveRevokeesAndSafelyRemoveDeadOnes(key);
        }
コード例 #3
0
 public void SetUp()
 {
     try
     {
         Environment.SetEnvironmentVariable("GIGYA_CONFIG_ROOT", AppDomain.CurrentDomain.BaseDirectory, EnvironmentVariableTarget.Process);
         kernel = new TestingKernel <ConsoleLog>((kernel) =>
         {
             var revokingManager = new FakeRevokingManager();
             kernel.Rebind <IRevokeListener>().ToConstant(revokingManager);
             kernel.Rebind <ICacheRevoker>().ToConstant(revokingManager);
         });
         ResolutionRoot = kernel;
     }
     catch (Exception ex)
     {
         Console.Write(ex);
         throw;
     }
 }