Esempio n. 1
0
        public void ParseConnectionString()
        {
            ConnectionStringValues values = ConnectionStringValues.CreateFromConnectionString(connectionString);

            Assert.AreEqual(values.ServiceBusEndpoint, "https://YOURSERVICEBUS.servicebus.windows.net/", true);
            Assert.AreEqual(values.SasKeyName, "YOURSASNAME", false);
            Assert.AreEqual(values.SasKeyValue, "YOURSASKEY", false);
        }
Esempio n. 2
0
        public void BuildToken()
        {
            ConnectionStringValues values = ConnectionStringValues.CreateFromConnectionString(connectionString);

            TimeSpan validFor  = new TimeSpan(1, 0, 0);
            DateTime expiresOn = DateTime.Now.Add(validFor);

            Token token = TokenManager.GetToken(values, validFor.TotalSeconds);

            Assert.AreEqual(token.IsExpired, false);
            Assert.AreEqual(token.ExpiresOn > expiresOn, true);
            Assert.AreNotEqual(token.Value, string.Empty);

            Trace.WriteLine(token.Value);
        }