public async Task RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new DealsClient(connection);

                var filters = new DealFilters
                {
                    PageSize  = 1,
                    PageCount = 1,
                    StartPage = 0,
                    Status    = DealStatus.lost,
                };

                await client.GetAllForCurrent(filters);

                Received.InOrder(async() =>
                {
                    await connection.GetAll <Deal>(
                        Arg.Is <Uri>(u => u.ToString() == "deals"),
                        Arg.Is <Dictionary <string, string> >(d => d.Count == 2 &&
                                                              d["owned_by_you"] == "1" &&
                                                              d["status"] == "lost"),
                        Arg.Is <ApiOptions>(o => o.PageSize == 1 &&
                                            o.PageCount == 1 &&
                                            o.StartPage == 0));
                });
            }
            public async Task ReturnsCorrectCountWithoutStart()
            {
                var pipedrive = Helper.GetAuthenticatedClient();

                var options = new DealFilters
                {
                    PageSize  = 3,
                    PageCount = 1
                };

                var deals = await pipedrive.Deal.GetAll(options);

                Assert.Equal(3, deals.Count);
            }
            public async Task ReturnsDistinctInfosBasedOnStartPage()
            {
                var pipedrive = Helper.GetAuthenticatedClient();

                var startOptions = new DealFilters
                {
                    PageSize  = 1,
                    PageCount = 1
                };

                var firstPage = await pipedrive.Deal.GetAll(startOptions);

                var skipStartOptions = new DealFilters
                {
                    PageSize  = 1,
                    PageCount = 1,
                    StartPage = 1
                };

                var secondPage = await pipedrive.Deal.GetAll(skipStartOptions);

                Assert.NotEqual(firstPage[0].Id, secondPage[0].Id);
            }