예제 #1
0
        public void LoadCredentialsFromXmlFile()
        {
            const string fileName = "TestLoad.xml";

            //Save the file
            var accessSaveCredentialsObjectUnderTest = new AccessCredentials(TestConsumerKey, TestConsumerSecret, TestAccessToken, AccessTokenSecret);

            accessSaveCredentialsObjectUnderTest.Save(fileName);

            //Load from file, new object
            var accessCredentialsObjectUnderTest = new AccessCredentials(fileName);

            accessCredentialsObjectUnderTest.Load(fileName);

            //Assert
            Assert.AreEqual(accessCredentialsObjectUnderTest.AccessToken, accessSaveCredentialsObjectUnderTest.AccessToken);
            Assert.AreEqual(accessCredentialsObjectUnderTest.AccessTokenSecret, accessSaveCredentialsObjectUnderTest.AccessTokenSecret);
            Assert.AreEqual(TestConsumerKey, accessCredentialsObjectUnderTest.ConsumerKey);
            Assert.AreEqual(accessCredentialsObjectUnderTest.ConsumerSecret, accessSaveCredentialsObjectUnderTest.ConsumerSecret);
        }