コード例 #1
0
        public void GenerateReport_ReportingEventDto_ValidationIsSuccess_WhenAllRequiredFieldsProvided()
        {
            CheckPropertyValidation cpv = new CheckPropertyValidation();
            var request    = ReportingEventDtoSetup();
            var errorCount = cpv.myValidation(request).Count();

            AreEqual((errorCount), 0);
        }
コード例 #2
0
        public void GenerateReport_ReportingEventDto_ValidationIsFailed_WhenAllApplicationNameNotProvided()
        {
            CheckPropertyValidation cpv = new CheckPropertyValidation();
            var request    = new ReportingEvent();
            var errorCount = cpv.myValidation(request);

            AreEqual((errorCount.Count), 5);
            AreEqual(errorCount.ToList()[0].ErrorMessage, "The Application field is required.");
            AreEqual(errorCount.ToList()[1].ErrorMessage, "The Permissions field is required.");
            AreEqual(errorCount.ToList()[2].ErrorMessage, "The EndDate field is required.");
            AreEqual(errorCount.ToList()[3].ErrorMessage, "The FileName field is required.");
            AreEqual(errorCount.ToList()[4].ErrorMessage, "The TenantId field is required.");
        }