public void CannotUnbuildANullReference()
        {
            IBuilder <BuilderStage> builder = new BuilderBase <BuilderStage>();
            Locator locator = CreateLocator();

            builder.TearDown(locator, (object)null);
        }
        public void TearDownWithNoLocatorDoesNotThrow()
        {
            IBuilder <BuilderStage> builder = new BuilderBase <BuilderStage>();
            Locator locator = null;

            MockStrategy strategy = new MockStrategy();

            builder.Strategies.Add(strategy, BuilderStage.PreCreation);

            builder.TearDown <object>(locator, "");
        }
        public void UnbuildStrategiesRunInOppositeOrderOfBuild()
        {
            IBuilder <BuilderStage> builder = new BuilderBase <BuilderStage>();
            Locator locator = CreateLocator();

            MockStrategy strategy = new MockStrategy();

            builder.Strategies.Add(new MockStrategy("Creation "), BuilderStage.Creation);
            builder.Strategies.Add(new MockStrategy("PostInitialization "), BuilderStage.PostInitialization);
            builder.Strategies.Add(new MockStrategy("PreCreation "), BuilderStage.PreCreation);
            builder.Strategies.Add(new MockStrategy("Initialization "), BuilderStage.Initialization);

            string s = builder.TearDown(locator, "");

            Assert.AreEqual("PostInitialization Initialization Creation PreCreation ", s);
        }