Ejemplo n.º 1
0
        public void AddList_OnlyName_NormalCase()
        {
            const string url  = "https://api.vk.com/method/friends.addList?name=тестовая метка&access_token=token";
            const string json =
                @"{
                    'response': {
                      'lid': 1
                    }
                  }";

            FriendsCategory cat = GetMockedFriendsCategory(url, json);

            long id = cat.AddList("тестовая метка");

            Assert.That(id, Is.EqualTo(1));
        }
Ejemplo n.º 2
0
        public void AddList_WithUserIds_NormalCase()
        {
            const string url  = "https://api.vk.com/method/friends.addList?name=тестовая метка&user_ids=1,2&access_token=token";
            const string json =
                @"{
                    'response': {
                      'lid': 2
                    }
                  }";

            FriendsCategory cat = GetMockedFriendsCategory(url, json);

            long id = cat.AddList("тестовая метка", new long[] { 1, 2 });

            Assert.That(id, Is.EqualTo(2));
        }
Ejemplo n.º 3
0
        public void AddList_NameIsEmpty_ThrowException()
        {
            FriendsCategory cat = GetMockedFriendsCategory("", "");

            This.Action(() => cat.AddList("")).Throws <ArgumentNullException>();
        }
Ejemplo n.º 4
0
        public void AddList_NameIsEmpty_ThrowException()
        {
            FriendsCategory cat = GetMockedFriendsCategory("", "");

            cat.AddList("");
        }