Exemple #1
0
        public static T Require <T>(params string[] scriptArgs) where T : Bau
        {
            var scriptPack = new BauScriptPack();

            scriptPack.Initialize(new ScriptPackSession(scriptArgs));
            return((T)scriptPack.Context);
        }
        public static void CanInitializeWhenScriptArgsAreNull()
        {
            // arrange
            var session = A.Fake<IScriptPackSession>();
            A.CallTo(() => session.ScriptArgs).Returns(null);
            var sut = new BauScriptPack();

            // act
            var ex = Record.Exception(() => sut.Initialize(session));

            // assert
            ex.Should().BeNull();
        }
Exemple #3
0
        public static void CanInitializeWhenScriptArgsAreNull()
        {
            // arrange
            var session = A.Fake <IScriptPackSession>();

            A.CallTo(() => session.ScriptArgs).Returns(null);
            var sut = new BauScriptPack();

            // act
            var ex = Record.Exception(() => sut.Initialize(session));

            // assert
            ex.Should().BeNull();
        }