Ejemplo n.º 1
0
        public void QueryDisabledSubverse()
        {
            var q = new QuerySubverseInformation("Disabled");
            var r = q.ExecuteAsync().Result;

            Assert.IsNull(r, "Expecting disabled sub info to return null");
        }
Ejemplo n.º 2
0
        public void QuerySubverse_Anon()
        {
            var q = new QuerySubverseInformation("anon");
            var r = q.ExecuteAsync().Result;

            Assert.IsNotNull(r, "Expecting a non-null return");
            Assert.AreEqual(true, r.IsAnonymized, "Expecting anonymized");
        }
Ejemplo n.º 3
0
        public void QuerySubverseInformation_verify_moderators_works()
        {
            TimeSpan cacheTime = TimeSpan.FromSeconds(5);

            var q = new QuerySubverseInformation("AuthorizedOnly");
            //q.CachePolicy.Duration = cacheTime; //Cache this request
            var result = q.ExecuteAsync().Result;

            Assert.IsNotNull(result, "Expected result is null");
            Assert.IsNotNull(result.Moderators, "Expected Moderators property is null, was expecting list");

            Assert.IsTrue(result.Moderators.Any(x => x == "unit"));
        }