コード例 #1
0
        public static IArrangeOrAssert <TSubject, TResult, TVars, TSequence> Given <TSubject, TResult, TVars, TSequence> (
            this IArrange <TSubject, TResult, TVars, TSequence> arrange,
            string text)
        {
            var controller = arrange.GetTestController();

            controller.AddNotImplementedAction <Arrange>(text);
            return((IArrangeOrAssert <TSubject, TResult, TVars, TSequence>)arrange);
        }
コード例 #2
0
        public static IArrangeOrAssert <TSubject, TResult, TVars, TSequence> GivenUsing <TSubject, TResult, TVars, TSequence, TDisposable> (
            this IArrange <TSubject, TResult, TVars, TSequence> arrange,
            string text,
            Func <ITestContext <TSubject, TResult, TVars, TSequence>, TDisposable> scopeProvider)
            where TDisposable : IDisposable
        {
            var controller = arrange.GetTestController();

            IDisposable scope = null;

            controller.AddSetupCleanup <Arrange, CleanupCommon>(
                "Create " + text,
                x => scope = scopeProvider((ITestContext <TSubject, TResult, TVars, TSequence>)x),
                "Dispose " + text,
                x => scope.Dispose());
            return((IArrangeOrAssert <TSubject, TResult, TVars, TSequence>)arrange);
        }