public void TokenParserTest_DeserializeInvalidString_ThrowsException()
        {
            // arrange
            var tokenCollectionSerializer = new TokenCollectionSerializer();

            // act, assert
            TU.AssertThrows(() => tokenCollectionSerializer.DeserializeTokenEmailPairs(TU.RandomAlphaNumString()));
        }
 public void TokenParserTest_DeserializeEmptyNullWhiteSpaceString_ReturnsEmptyCollection()
 {
     //arrange
     var tokenCollectionSerializer = new TokenCollectionSerializer();
     tokenCollectionSerializer.DeserializeTokenEmailPairs(string.Empty);
     tokenCollectionSerializer.DeserializeTokenEmailPairs(" ");
     tokenCollectionSerializer.DeserializeTokenEmailPairs(null);
 }
        public void TokenParserTest_Deserializes_TokenCollection()
        {
            //arrange
            var tokenCollectionSerializer = new TokenCollectionSerializer();

            //act
            var result = tokenCollectionSerializer.DeserializeTokenEmailPairs("a,b,c:d,e,f");

            //assert
            Assert.IsTrue(result["a"].AccessToken == "b");
            Assert.IsTrue(result["a"].AccessTokenSecret == "c");
            Assert.IsTrue(result["d"].AccessToken == "e");
            Assert.IsTrue(result["d"].AccessTokenSecret == "f");
        }
        public void TokenParserTest_Serializes_TokenCollection()
        {
            //arrange
            var tokenCollectionSerializer = new TokenCollectionSerializer();

            //act
            var result = tokenCollectionSerializer.SerializeTokenEmailPairs(new Dictionary<string, TokenInfo>
            {
                {"a",new TokenInfo { AccessToken = "b",AccessTokenSecret = "c"} },
                {"d",new TokenInfo { AccessToken = "e", AccessTokenSecret ="f"} },
            });

            //assert
            Assert.AreEqual("a,b,c:d,e,f", result);
        }