public void GetMonthlySalesAndPurches_NullDealerId_ShouldEqualToIdOne() { int?dealersIdNull = null; var monthlyOne = sut.GetMonthlyPurchaseAndSalePrice(1).Result.GetObject <IEnumerable <DatePurchaseAndSalePriceModel> >(); var monthlyNull = sut.GetMonthlyPurchaseAndSalePrice(dealersIdNull).Result.GetObject <IEnumerable <DatePurchaseAndSalePriceModel> >(); foreach (var item in monthlyOne) { var monthNull = monthlyNull.Single(i => i.Date.Date == item.Date.Date); Assert.AreEqual(item.PurchasesAmount, monthNull.PurchasesAmount); Assert.AreEqual(item.SalesAmount, monthNull.SalesAmount); } }