Example #1
0
        public void ThenReportIsOnList()
        {
            var reportDate    = (DateTime)ScenarioContext.Current[ReportDate];
            var reportDateDto = new ReportDate
            {
                Month = reportDate.Month,
                Year  = reportDate.Year
            };

            var buildingId = ScenarioContext.Current[BuildingId];
            var reports    = Client.Post <IEnumerable <ReportList>, ReportDate>($"buildings/{buildingId}/reports", reportDateDto);

            var reportId = (int)ScenarioContext.Current[ReportId];

            Assert.IsTrue(reports.SelectMany(r => r.Reports).Any(r => r.Id == reportId && r.UserName.Contains("MacBub")));
        }
Example #2
0
        public void ThenReportIsAddToEstimation()
        {
            var reportDate    = (DateTime)ScenarioContext.Current[ReportDate];
            var reportDateDto = new ReportDate
            {
                Month = reportDate.Month,
                Year  = reportDate.Year
            };

            var buildingId   = ScenarioContext.Current[BuildingId];
            var estimationId = ScenarioContext.Current[EstimationId];

            var reports =
                Client.Get <IEnumerable <EstimationReport> >($"buildings/{buildingId}/estimations/{estimationId}/reports");

            Assert.IsTrue(reports.Any(r => r.UserName.Contains("MacBub") && r.Date == reportDate));
        }