Example #1
0
        public void InValidateGenBankLocationEndData()
        {
            // Get Values from XML node.
            string position = utilityObj.xmlUtil.GetTextValue(
                Constants.LocationWithEndDataNode, Constants.Position);

            // Build a location.
            LocationResolver locResolver = new LocationResolver();

            // Validate whether mentioned end data is present in the location
            // or not.
            try
            {
                locResolver.IsInEnd(null, Int32.Parse(position, (IFormatProvider)null));
                Assert.Fail();
            }
            catch (ArgumentNullException)
            {
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                                                       "GenBankFeatures P2 : Validate the exception successfully"));
                Console.WriteLine(string.Format((IFormatProvider)null,
                                                "GenBankFeatures P2 : Validate the exception successfully"));
            }

            // Validate IsInStart method exception.
            try
            {
                locResolver.IsInStart(null, Int32.Parse(position, (IFormatProvider)null));
                Assert.Fail();
            }
            catch (ArgumentNullException)
            {
                LogExceptionMessage();
            }

            // Validate IsInRange method exception.
            try
            {
                locResolver.IsInRange(null, Int32.Parse(position, (IFormatProvider)null));
                Assert.Fail();
            }
            catch (ArgumentNullException)
            {
                LogExceptionMessage();
            }
        }
Example #2
0
        /// <summary>
        /// InValidate GenBank location with invalid Start location data.
        /// <param name="endData">Start data used for different test cases.</param>
        /// </summary>
        private static void InValidateLocationStartData(string startData)
        {
            // Build a location.
            LocationResolver locResolver = new LocationResolver();
            string           location    = "123.125";
            ILocationBuilder locBuilder  = new LocationBuilder();
            ILocation        loc         = locBuilder.GetLocation(location);

            // Set Invalid end data Validate GetStart method exception.
            loc.StartData = startData;
            try
            {
                locResolver.IsInStart(loc, 124);
                Assert.Fail();
            }
            catch (Exception)
            {
                LogExceptionMessage();
            }
        }