コード例 #1
0
        public async Task ShouldNotRunWithoutSettingRunningMode()
        {
            var parameters = new ArgumentParsingTarget();

            _subject = new FakeGenValRunner(_fakeAutofac.GetContainer().BeginLifetimeScope());
            var result = await _subject.Run(parameters, GenValMode.Unset);

            Assert.AreNotEqual(0, result);
        }
コード例 #2
0
        public async Task ShouldRun(GenValMode genValMode, string registrationFile, string responseFile, string answerFile, int returnCode)
        {
            var parameters = new ArgumentParsingTarget
            {
                RegistrationFile = genValMode == GenValMode.Generate ? new FileInfo(registrationFile) : null,
                ResponseFile     = genValMode == GenValMode.Validate ? new FileInfo(responseFile) : null,
                AnswerFile       = genValMode == GenValMode.Validate ? new FileInfo(answerFile) : null
            };

            var result = int.MinValue;

            try
            {
                _subject = new FakeGenValRunner(_fakeAutofac.GetContainer().BeginLifetimeScope());
                result   = await _subject.Run(parameters, genValMode);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Assert.AreEqual(returnCode, result);
        }