コード例 #1
0
        public void MarkPackageFailed_WithNonExistingPackage_ThrowsArgumentException()
        {
            var packages   = CreateDefaultPackages();
            var textOutput = A.Fake <ITextFileOutput>();
            var storage    = new TestablePackageStorage(new LogEntry[0], packages);

            Assert.Throws <ArgumentException>(() => storage.MarkPackageFailed(new Package())).Message.Should().Contain("does not exist in the storage.");
        }
コード例 #2
0
        public void MarkPackageFailed_WithNullPackage_ThrowsArgumentException()
        {
            var packages   = CreateDefaultPackages();
            var textOutput = A.Fake <ITextFileOutput>();
            var storage    = new TestablePackageStorage(new LogEntry[0], packages);

            Assert.Throws <ArgumentException>(() => storage.MarkPackageFailed(null)).Message.Should().Contain("Cannot mark 'null' as solved.");
        }
コード例 #3
0
        public void MarkPackageFailed_WithPackageInCorrectState_Runs()
        {
            var packages   = CreateDefaultPackages().ToArray();
            var textOutput = A.Fake <ITextFileOutput>();
            var storage    = new TestablePackageStorage(new LogEntry[0], packages);

            var p = storage.GetNextPackage();

            storage.MarkPackageFailed(packages.First());

            storage.OrderedPackages[PackageEvaluationStates.Failed].Should().Contain(packages.First());
        }