예제 #1
0
        public void TestResponseShouldBeFilteredBySearch()
        {
            var response = new GetContactsResponse
            {
                Code             = ResponseCode.Success,
                ApprovedContacts =
                    new List <Contact>
                {
                    new Contact
                    {
                        ChatAddress = Hash.Empty.Value,
                        Request     = false,
                        Rejected    = false,
                        Name        = "hans"
                    }
                },
                PendingContactRequests =
                    new List <Contact>
                {
                    new Contact
                    {
                        ChatAddress = Hash.Empty.Value,
                        Request     = true,
                        Rejected    = false,
                        Name        = "Peter"
                    }
                }
            };

            var viewModels = GetContactsPresenter.Present(response, new ViewCellObject(), "Hans");

            Assert.AreEqual(1, viewModels.Count);
        }
예제 #2
0
        public void TestResponseContactsGetMappedToViewModelWithoutSearch()
        {
            var response = new GetContactsResponse
            {
                Code             = ResponseCode.Success,
                ApprovedContacts =
                    new List <Contact>
                {
                    new Contact {
                        ChatAddress = Hash.Empty.Value, Request = false, Rejected = false
                    }
                },
                PendingContactRequests =
                    new List <Contact>
                {
                    new Contact {
                        ChatAddress = Hash.Empty.Value, Request = true, Rejected = false
                    }
                }
            };

            var viewModels = GetContactsPresenter.Present(response, new ViewCellObject());

            Assert.AreEqual(2, viewModels.Count);
        }