Ejemplo n.º 1
0
        public void ImportingFromDirectoryWithNoFilesThrows()
        {
            var testDir = new TestDirBuilder("testdir3");

            using (testDir.Pushd())
            {
                Testing.AssertThrows <Exception>(
                    () => cmdlet.ExecuteCmdlet(),
                    string.Format(Resources.NoPublishSettingsFilesFoundMessage, Directory.GetCurrentDirectory()));
            }
        }
Ejemplo n.º 2
0
        public void ImportFindsFileInCurrentDirectoryIfNoPathGiven()
        {
            var testDir = new TestDirBuilder("testdir")
                          .AddFile(Data.ValidPublishSettings.First(), "myfile.publishsettings");

            using (testDir.Pushd())
            {
                cmdlet.ExecuteCmdlet();
            }
            Assert.AreEqual(profile.CurrentSubscription.SubscriptionName, Data.Subscription1);
            Assert.IsTrue(profile.CurrentSubscription.IsDefault);
            Assert.AreEqual(Path.GetFullPath(testDir.FilePaths[0]), mockCommandRuntime.OutputPipeline[0].ToString());
        }
 public void ImportingFromDirectoryWithNoFilesThrows()
 {
     var testDir = new TestDirBuilder("testdir3");
     using (testDir.Pushd())
     {
         Testing.AssertThrows<Exception>(
             () => cmdlet.ExecuteCmdlet(),
             string.Format(Resources.NoPublishSettingsFilesFoundMessage, Directory.GetCurrentDirectory()));
     }
 }
        public void ImportFindsFileInCurrentDirectoryIfNoPathGiven()
        {
            var testDir = new TestDirBuilder("testdir")
                .AddFile(Data.ValidPublishSettings.First(), "myfile.publishsettings");

            using (testDir.Pushd())
            {
                cmdlet.ExecuteCmdlet();
            }
            Assert.AreEqual(profile.CurrentSubscription.SubscriptionName, Data.Subscription1);
            Assert.IsTrue(profile.CurrentSubscription.IsDefault);
            Assert.AreEqual(Path.GetFullPath(testDir.FilePaths[0]), mockCommandRuntime.OutputPipeline[0].ToString());
            Assert.IsNotNull(profile.CurrentSubscription.SqlDatabaseDnsSuffix);
        }