Esempio n. 1
0
            public void WillOnlyReturnCuratedPackageVersions()
            {
                // I.e. Not all versions for a registration
                var service = new TestableCuratedFeedService();

                var stubCuratedPackageVersion = new CuratedPackageVersion
                {
                    Key                    = 101,
                    Package                = service.StubPackage,
                    PackageKey             = service.StubPackage.Key,
                    CuratedFeed            = service.StubCuratedPackageRegistration_ForFeed1.CuratedFeed,
                    CuratedFeedKey         = service.StubCuratedPackageRegistration_ForFeed1.CuratedFeedKey,
                    CuratedPackage         = service.StubCuratedPackageRegistration_ForFeed1,
                    CuratedPackageKey      = service.StubCuratedPackageRegistration_ForFeed1.Key,
                    PackageRegistration    = service.StubPackage.PackageRegistration,
                    PackageRegistrationKey = service.StubPackage.PackageRegistrationKey
                };

                service.StubCuratedPackageRegistration_ForFeed1.CuratedPackageVersions.Add(stubCuratedPackageVersion);

                var packages = service.GetPackages(service.StubCuratedFeed.Name).ToList();

                Assert.Contains(service.StubPackage, packages);
                Assert.DoesNotContain(service.StubPackage_IncompatibleVersion, packages);
            }
Esempio n. 2
0
            public void WillOnlyReturnPackageVersionsForIncludedPackageRegistrations()
            {
                var service = new TestableCuratedFeedService();

                var stubCuratedPackageVersion = new CuratedPackageVersion
                {
                    Key                    = 101,
                    Package                = service.StubPackage,
                    PackageKey             = service.StubPackage.Key,
                    CuratedFeed            = service.StubCuratedPackageRegistration_ForFeed1.CuratedFeed,
                    CuratedFeedKey         = service.StubCuratedPackageRegistration_ForFeed1.CuratedFeedKey,
                    CuratedPackage         = service.StubCuratedPackageRegistration_ForFeed1,
                    CuratedPackageKey      = service.StubCuratedPackageRegistration_ForFeed1.Key,
                    PackageRegistration    = service.StubPackage.PackageRegistration,
                    PackageRegistrationKey = service.StubPackage.PackageRegistrationKey
                };
                var stubCuratedPackageVersion_ForFeed1_NotIncluded = new CuratedPackageVersion
                {
                    Key                    = 101,
                    Package                = service.StubPackage_ForFeed1_NotIncluded,
                    PackageKey             = service.StubPackage_ForFeed1_NotIncluded.Key,
                    CuratedFeed            = service.StubCuratedPackageRegistration_ForFeed1_NotIncluded.CuratedFeed,
                    CuratedFeedKey         = service.StubCuratedPackageRegistration_ForFeed1_NotIncluded.CuratedFeedKey,
                    CuratedPackage         = service.StubCuratedPackageRegistration_ForFeed1_NotIncluded,
                    CuratedPackageKey      = service.StubCuratedPackageRegistration_ForFeed1_NotIncluded.Key,
                    PackageRegistration    = service.StubPackage_ForFeed1_NotIncluded.PackageRegistration,
                    PackageRegistrationKey = service.StubPackage_ForFeed1_NotIncluded.PackageRegistrationKey
                };

                service.StubCuratedPackageRegistration_ForFeed1.CuratedPackageVersions.Add(stubCuratedPackageVersion);
                service.StubCuratedPackageRegistration_ForFeed1_NotIncluded.CuratedPackageVersions.Add(stubCuratedPackageVersion_ForFeed1_NotIncluded);

                var packages = service.GetPackages(service.StubCuratedFeed.Name).ToList();

                Assert.Contains(service.StubPackage, packages);
                Assert.DoesNotContain(service.StubPackage_ForFeed1_NotIncluded, packages);
            }
            public void WillOnlyReturnCuratedPackageVersions()
            {
                // I.e. Not all versions for a registration
                var service = new TestableCuratedFeedService();

                var stubCuratedPackageVersion = new CuratedPackageVersion
                {
                    Key = 101,
                    Package = service.StubPackage,
                    PackageKey = service.StubPackage.Key,
                    CuratedFeed = service.StubCuratedPackageRegistration_ForFeed1.CuratedFeed,
                    CuratedFeedKey = service.StubCuratedPackageRegistration_ForFeed1.CuratedFeedKey,
                    CuratedPackage = service.StubCuratedPackageRegistration_ForFeed1,
                    CuratedPackageKey = service.StubCuratedPackageRegistration_ForFeed1.Key,
                    PackageRegistration = service.StubPackage.PackageRegistration,
                    PackageRegistrationKey = service.StubPackage.PackageRegistrationKey
                };

                service.StubCuratedPackageRegistration_ForFeed1.CuratedPackageVersions.Add(stubCuratedPackageVersion);

                var packages = service.GetPackages(service.StubCuratedFeed.Name).ToList();

                Assert.Contains(service.StubPackage, packages);
                Assert.DoesNotContain(service.StubPackage_IncompatibleVersion, packages);
            }
            public void WillOnlyReturnPackageVersionsForIncludedPackageRegistrations()
            {
                var service = new TestableCuratedFeedService();

                var stubCuratedPackageVersion = new CuratedPackageVersion
                {
                    Key = 101,
                    Package = service.StubPackage,
                    PackageKey = service.StubPackage.Key,
                    CuratedFeed = service.StubCuratedPackageRegistration_ForFeed1.CuratedFeed,
                    CuratedFeedKey = service.StubCuratedPackageRegistration_ForFeed1.CuratedFeedKey,
                    CuratedPackage = service.StubCuratedPackageRegistration_ForFeed1,
                    CuratedPackageKey = service.StubCuratedPackageRegistration_ForFeed1.Key,
                    PackageRegistration = service.StubPackage.PackageRegistration,
                    PackageRegistrationKey = service.StubPackage.PackageRegistrationKey
                };
                var stubCuratedPackageVersion_ForFeed1_NotIncluded = new CuratedPackageVersion
                {
                    Key = 101,
                    Package = service.StubPackage_ForFeed1_NotIncluded,
                    PackageKey = service.StubPackage_ForFeed1_NotIncluded.Key,
                    CuratedFeed = service.StubCuratedPackageRegistration_ForFeed1_NotIncluded.CuratedFeed,
                    CuratedFeedKey = service.StubCuratedPackageRegistration_ForFeed1_NotIncluded.CuratedFeedKey,
                    CuratedPackage = service.StubCuratedPackageRegistration_ForFeed1_NotIncluded,
                    CuratedPackageKey = service.StubCuratedPackageRegistration_ForFeed1_NotIncluded.Key,
                    PackageRegistration = service.StubPackage_ForFeed1_NotIncluded.PackageRegistration,
                    PackageRegistrationKey = service.StubPackage_ForFeed1_NotIncluded.PackageRegistrationKey
                };

                service.StubCuratedPackageRegistration_ForFeed1.CuratedPackageVersions.Add(stubCuratedPackageVersion);
                service.StubCuratedPackageRegistration_ForFeed1_NotIncluded.CuratedPackageVersions.Add(stubCuratedPackageVersion_ForFeed1_NotIncluded);

                var packages = service.GetPackages(service.StubCuratedFeed.Name).ToList();

                Assert.Contains(service.StubPackage, packages);
                Assert.DoesNotContain(service.StubPackage_ForFeed1_NotIncluded, packages);
            }