public void TestGetRuntimes() { using (FileSystemHelper files = new FileSystemHelper(this)) { string manifest = RuntimePackageHelper.GetTestManifest(files); CloudRuntimeCollection runtimes; CloudRuntimeCollection.CreateCloudRuntimeCollection(out runtimes, manifest); cmdlet.GetAzureRuntimesProcess(string.Empty, manifest); IEnumerable <CloudRuntimePackage> actual = System.Management.Automation.LanguagePrimitives.GetEnumerable(mockCommandRuntime.OutputPipeline).Cast <CloudRuntimePackage>(); Assert.Equal <int>(runtimes.Count, actual.Count()); Assert.True(runtimes.All <CloudRuntimePackage>(p => actual.Any <CloudRuntimePackage>(p2 => p2.PackageUri.Equals(p.PackageUri)))); } }
public void TestGetRuntimes() { using (FileSystemHelper files = new FileSystemHelper(this)) { string manifest = RuntimePackageHelper.GetTestManifest(files); CloudRuntimeCollection runtimes; CloudRuntimeCollection.CreateCloudRuntimeCollection(out runtimes, manifest); cmdlet.GetAzureRuntimesProcess(string.Empty, manifest); List <CloudRuntimePackage> actual = mockCommandRuntime.OutputPipeline[0] as List <CloudRuntimePackage>; Assert.AreEqual <int>(runtimes.Count, actual.Count); Assert.IsTrue(runtimes.All <CloudRuntimePackage>(p => actual.Any <CloudRuntimePackage>(p2 => p2.PackageUri.Equals(p.PackageUri)))); } }