Ejemplo n.º 1
0
        public void ShouldThrowExceptionOnOutOfRangeReference()
        {
            var k = false;

            try {
                UserVoice.Client     client = getSignedClient();
                UserVoice.Collection users  = client.LoginAsOwner().GetCollection("/api/v1/users", 3);
                Console.WriteLine("Getting user out of range FAILED: " + users[3]);
            } catch (IndexOutOfRangeException e) {
                e = e;
                k = true;
            }
            AssertTrue(k);
        }
Ejemplo n.º 2
0
        public void ShouldForLoopMoreThan10Users()
        {
            UserVoice.Client     client = getSignedClient();
            UserVoice.Collection users  = client.LoginAsOwner().GetCollection("/api/v1/users");
            int times = 3;

            for (int i = 0; i < users.Count(); i++)
            {
                if (--times <= 0)
                {
                    break;
                }
                //Console.WriteLine("User: " + users[i]);
            }
            AssertTrue(users.Count() > 10);
        }
Ejemplo n.º 3
0
        public void ShouldGetMoreThan10Users()
        {
            UserVoice.Client     client = getSignedClient();
            UserVoice.Collection users  = client.LoginAsOwner().GetCollection("/api/v1/users");
            int times = 3;

            foreach (var k in users)
            {
                if (--times <= 0)
                {
                    break;
                }
                //Console.WriteLine("User: " + k);
            }
            AssertTrue(users.Count() > 10);
        }
Ejemplo n.º 4
0
 public void ShouldGetOnly3Users()
 {
     UserVoice.Client     client = getSignedClient();
     UserVoice.Collection users  = client.LoginAsOwner().GetCollection("/api/v1/users", 3);
     AssertEqual(3, users.Count());
 }
Ejemplo n.º 5
0
 public void ShouldGetNoUsers()
 {
     UserVoice.Client     client = getSignedClient();
     UserVoice.Collection users  = client.LoginAsOwner().GetCollection("/api/v1/users/search?query=from:[email protected]");
     AssertEqual(0, users.Count());
 }