Ejemplo n.º 1
0
        public void Startup()
        {
            ManagerMockBadStartup bad = ManagerMockBadStartup.Instantiate(applicationManagerMock.Object);

            Assert.Throws <ManagerStartException>(() => bad.Start());

            ManagerMockFailingStartup fail = ManagerMockFailingStartup.Instantiate(applicationManagerMock.Object);

            IResult result = fail.Start();

            Assert.Equal(ResultCode.Failure, result.ResultCode);
            Assert.Equal(fail.State, State.Faulted);
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Instantiates the Manager.
 /// </summary>
 /// <param name="manager">The ApplicationManager dependency.</param>
 /// <returns>The instantiated Manager.</returns>
 public static ManagerMockBadStartup Instantiate(IApplicationManager manager)
 {
     // remove the code that makes this a singleton so that test runners can get a fresh instance each time.
     instance = new ManagerMockBadStartup(manager);
     return(instance);
 }