public async Task WillCuratePackageUsingAllPackageCurators()
            {
                var firstStubCurator = new Mock<IAutomaticPackageCurator>();
                var secondStubCurator = new Mock<IAutomaticPackageCurator>();

                var cmd = new AutomaticallyCuratePackageCommand(new List<IAutomaticPackageCurator>()
                {
                    firstStubCurator.Object,
                    secondStubCurator.Object
                }, null);

                await cmd.ExecuteAsync(new Package(), new Mock<PackageArchiveReader>(TestPackage.CreateTestPackageStream("test", "1.0.0")).Object, commitChanges: true);

                firstStubCurator.Verify(stub => stub.CurateAsync(It.IsAny<Package>(), It.IsAny<PackageArchiveReader>(), true));
                secondStubCurator.Verify(stub => stub.CurateAsync(It.IsAny<Package>(), It.IsAny<PackageArchiveReader>(), true));
            }
            public async Task WillCuratePackageUsingAllPackageCurators()
            {
                var firstStubCurator  = new Mock <IAutomaticPackageCurator>();
                var secondStubCurator = new Mock <IAutomaticPackageCurator>();

                var cmd = new AutomaticallyCuratePackageCommand(new List <IAutomaticPackageCurator>()
                {
                    firstStubCurator.Object,
                    secondStubCurator.Object
                }, null);

                await cmd.ExecuteAsync(new Package(), new Mock <PackageArchiveReader>(TestPackage.CreateTestPackageStream("test", "1.0.0")).Object, commitChanges : true);

                firstStubCurator.Verify(stub => stub.CurateAsync(It.IsAny <Package>(), It.IsAny <PackageArchiveReader>(), true));
                secondStubCurator.Verify(stub => stub.CurateAsync(It.IsAny <Package>(), It.IsAny <PackageArchiveReader>(), true));
            }
Exemplo n.º 3
0
            public void WillCuratePackageUsingAllPackageCurators()
            {
                var firstStubCurator  = new Mock <IAutomaticPackageCurator>();
                var secondStubCurator = new Mock <IAutomaticPackageCurator>();

                var cmd = new AutomaticallyCuratePackageCommand(new List <IAutomaticPackageCurator>()
                {
                    firstStubCurator.Object,
                    secondStubCurator.Object
                }, null);


                cmd.Execute(new Package(), new Mock <INupkg>().Object, commitChanges: true);

                firstStubCurator.Verify(stub => stub.Curate(It.IsAny <Package>(), It.IsAny <INupkg>(), true));
                secondStubCurator.Verify(stub => stub.Curate(It.IsAny <Package>(), It.IsAny <INupkg>(), true));
            }
            public void WillCuratePackageUsingAllPackageCurators()
            {
                var firstStubCurator = new Mock<IAutomaticPackageCurator>();
                var secondStubCurator = new Mock<IAutomaticPackageCurator>();

                var cmd = new AutomaticallyCuratePackageCommand(new List<IAutomaticPackageCurator>()
                {
                    firstStubCurator.Object,
                    secondStubCurator.Object
                }, null);
                

                cmd.Execute(new Package(), new Mock<INupkg>().Object, commitChanges: true);

                firstStubCurator.Verify(stub => stub.Curate(It.IsAny<Package>(), It.IsAny<INupkg>(), true));
                secondStubCurator.Verify(stub => stub.Curate(It.IsAny<Package>(), It.IsAny<INupkg>(), true));
            }