private List <RangeWiseReadings> ExpectedResultList()
        {
            List <RangeWiseReadings> expectedRangeWiseReadings = new List <RangeWiseReadings>();
            RangeWiseReadings        readingInformation        = new RangeWiseReadings();

            readingInformation.rangeName     = "3-5";
            readingInformation.totalReadings = 4;
            expectedRangeWiseReadings.Add(readingInformation);
            readingInformation               = new RangeWiseReadings();
            readingInformation.rangeName     = "10-12";
            readingInformation.totalReadings = 3;
            expectedRangeWiseReadings.Add(readingInformation);
            return(expectedRangeWiseReadings);
        }
Esempio n. 2
0
        private static bool AssertPropertiesOfObjectAreEquals(RangeWiseReadings actualObject, RangeWiseReadings expectedObject)
        {
            bool result = false;

            PropertyInfo[] properties = expectedObject.GetType().GetProperties();
            foreach (PropertyInfo property in properties)
            {
                object expectedValue = property.GetValue(expectedObject, null);
                object actualValue   = property.GetValue(actualObject, null);
                if (!Equals(expectedValue, actualValue))
                {
                    result = false;
                    break;
                }
            }
            result = true;
            return(result);
        }