public void Write_UnitTest() { String filePath = default(String); CredentialsStore credentials = default(CredentialsStore); ExecuteMethod( () => { filePath = default(String); //No Constructor credentials = new CredentialsStore(); Write_PreCondition(ref filePath, ref credentials); }, () => { CredentialsProvider.Write(filePath, credentials); }, () => { Write_PostValidate(filePath, credentials); }); }
public void ReadWrite_UnitTest() { const string fileName = "ReST_Credentiials.xml"; var sourceData = new CredentialsStore(); sourceData.BasicAuthorizationUsername = "******"; sourceData.BasicAuthorizationPassword = "******"; sourceData.VsoCollection = "MyVsoCollection"; Assert.AreEqual(3, sourceData.Values.Count); CredentialsProvider.Write(fileName, sourceData); CredentialsStore resultData = CredentialsProvider.Read(fileName); Assert.AreEqual(sourceData.BasicAuthorizationUsername, resultData.BasicAuthorizationUsername); Assert.AreEqual(sourceData.BasicAuthorizationPassword, resultData.BasicAuthorizationPassword); Assert.AreEqual(sourceData.VsoCollection, resultData.VsoCollection); }