Exemplo n.º 1
0
        //private DateTime _TestPeriodEndDate = new DateTime( 2019, 3, 31 );

        /// <summary>
        /// Performs the initialization required for tests in this class to execute.
        /// </summary>
        /// <param name="context"></param>
        //[ClassInitialize]
        //public static void Initialize( TestContext context )
        //{
        //}

        protected override void OnValidateTestData(out bool isValid, out string stateMessage)
        {
            try
            {
                // Verify that the necessary test data exists by retrieving a well-known test record.
                var dataContext = GetNewDataContext();

                var prayerRequestService = new PrayerRequestService(dataContext);

                var testEntryId = prayerRequestService.GetId(TestGuids.PrayerRequestGuid.AllChurchForEmployment.AsGuid());

                if (testEntryId == null)
                {
                    throw new Exception("Prayer Request test data is either incomplete or does not exist in this database.");
                }

                isValid      = true;
                stateMessage = null;
            }
            catch (Exception ex)
            {
                isValid      = false;
                stateMessage = ex.Message;
            }
        }