Ejemplo n.º 1
0
        public void Session_Disposed()
        {
            var services = new MockContainer(MockBehavior.Strict)
                           .Push <IRestartManagerService>()
                           .Pop();

            var session = new RestartManagerSession(services);

            session.Dispose();

            services.Verify <IRestartManagerService>(x => x.EndSession(0), Times.Once);

            fixture.Create()
            .AddCommand(CommandName)
            .AddParameter("Session", session)
            .Invoke();

            services.Verify <IRestartManagerService>(x => x.EndSession(0), Times.Once);
        }
Ejemplo n.º 2
0
        public void GetParameterOrVariable_Field()
        {
            var services = new MockContainer(MockBehavior.Strict)
                           .Push <IRestartManagerService>()
                           .Pop()
                           .Push <IVariableService, MockVariableService>()
                           .GetValue(SessionManager.VariableName, sessionService)
                           .Pop();

            var session = new RestartManagerSession(services);

            try
            {
                var actual = SessionManager.GetParameterOrVariable(services, ref session, fixture.Variables);
                Assert.Same(session, actual);
            }
            finally
            {
                session.Dispose();
            }
        }
Ejemplo n.º 3
0
 public void Dispose()
 {
     sessionService.Dispose();
     sessionVariable.Dispose();
 }