public void CalculateTotalValueOfGroupedRegistrations_Should_Return_0_Count() { List <List <RegistrationDTO> > groupedRegistrationsEmpty = new List <List <RegistrationDTO> >(); List <RegistrationDayResultDTO> dayResults = CalculationService.CalculateTotalValueOfGroupedRegistrations(groupedRegistrationsEmpty); Assert.Equal <double>(0, dayResults.Count); }
public void CalculateTotalValueOfGroupedRegistrations_Should_Return_125() { List <List <RegistrationDTO> > groupedRegistrations = new List <List <RegistrationDTO> >() { new List <RegistrationDTO>() { new RegistrationDTO { RegistrationId = Guid.Parse("3be9f257-22a3-4b91-8aa4-9ec1a30a4ff1"), GoogleUserId = "qdVxjYLuvHQRJc5BhOcncgB5jJ43", Time = DateTime.Now, Value = 65, TopicId = Guid.Parse("48fb5b75-1094-4c13-a288-c571f9e23cb2") }, new RegistrationDTO { RegistrationId = Guid.Parse("6f3f51bc-37b6-4b94-8fef-fba63aebe5c1"), GoogleUserId = "qdVxjYLuvHQRJc5BhOcncgB5jJ43", Time = DateTime.Now, Value = 60, TopicId = Guid.Parse("f8902f75-9058-48ba-8f88-bc7ce77896f5") } }, new List <RegistrationDTO>() { new RegistrationDTO { RegistrationId = Guid.Parse("c0708050-8d2e-4b5c-b161-7f46485cf8b8"), GoogleUserId = "qdVxjYLuvHQRJc5BhOcncgB5jJ43", Time = DateTime.Now.AddDays(1), Value = 60, TopicId = Guid.Parse("a700c9ae-58ab-44a2-a65e-b6227c69513c") } } }; List <RegistrationDayResultDTO> dayResults = CalculationService.CalculateTotalValueOfGroupedRegistrations(groupedRegistrations); Assert.Equal <double>(125, dayResults[0].Value); }