Пример #1
0
 /// <summary>
 /// Xml Data to be loaded into DataSet for testing - correct data
 /// </summary>
 /// <returns>file resource</returns>
 private static IDictionary <string, IResourceDetails> GetCorrectData()
 {
     return(new Dictionary <string, IResourceDetails>(1, StringComparer.OrdinalIgnoreCase)
     {
         { TestResourceName, EmbeddedResources.CreateResourceDetails(ValidDataRaw) }
     });
 }
Пример #2
0
		/// <summary>
		/// Loads the gate data set.
		/// </summary>
		/// <param name="content">The content.</param>
		/// <returns>Gate data set.</returns>
		private static GateDataSet LoadGateDataSet(string content)
		{
			IDictionary<string, IResourceDetails> resources =
				new Dictionary<string, IResourceDetails>(2, StringComparer.OrdinalIgnoreCase)
			{
				{ ResourceNames.Gates, EmbeddedResources.CreateResourceDetails(content) },
				{ ResourceNames.TestGroups, EmbeddedResources.CreateResourceDetails(ValidDataRaw) }
			};

			GateDataSet dataSet = new GateDataSet(ResourceNames.Gates, ResourceNames.TestGroups);
			dataSet.Load(resources);
			return dataSet;
		}
Пример #3
0
        /// <summary>
        /// Verifies that DataSet loads with one parsing error from given resource
        /// </summary>
        /// <param name="resourceString">resource content as a string</param>
        private void LoadDataSetWithOneError(string resourceString)
        {
            FailOnErrors = false;

            IDictionary <string, IResourceDetails> resources =
                new Dictionary <string, IResourceDetails>(1, StringComparer.OrdinalIgnoreCase)
            {
                { TestResourceName, EmbeddedResources.CreateResourceDetails(resourceString) }
            };

            TestGroupsDataSet testGroupsDataSet = new TestGroupsDataSet(TestResourceName);

            // Expecting DataSet load to return false
            Assert.False(testGroupsDataSet.Load(resources), "Expecting DataSet load to return false.");
            // Expecting DataSet to be loaded
            Assert.False(testGroupsDataSet.IsHealthy, "Expecting DataSet to be not healthy.");
            // Expecting one error
            Assert.Equal(1, testGroupsDataSet.Errors.Count);
        }