Beispiel #1
0
        public void CredentialsFileIsCreatedIfNotExists()
        {
            using (var t = new TempDirectory("b2.net"))
            {
                var credentialsPath = Path.Combine(t.FullPath, "credentials.json");

                using (var cc = new ConsoleCapture())
                {
                    Assert.AreEqual(0, new Program().Run("auth", "--path", credentialsPath, "--account", "wallace", "--appkey", "gorgonzola"));
                    Assert.AreEqual("", cc.StandardOutput);
                    Assert.AreEqual("", cc.StandardError);
                }

                using (var cc = new ConsoleCapture())
                {
                    Assert.AreEqual(0, new Program().Run("auth", "--path", credentialsPath));
                    Assert.AreEqual("Account Id: 'wallace',  Application Key: 'gorgonzola'\r\n", cc.StandardOutput);
                    Assert.AreEqual("", cc.StandardError);
                }
            }
        }