public void Should_not_load_the_objectTypes_if_the_objectType_attribute_was_already_set()
        {
            IDocumentSession         fakeSession    = this.GetSession();
            CollectRequest           collectRequest = new CollectRequestFactory().CreateCollectRequest(fakeSession).Item2;
            IEnumerable <ObjectType> ovalObjects    = collectRequest.GetObjectTypes(fakeSession);

            Assert.IsNotNull(ovalObjects);

            IEnumerable <ObjectType> sameObjectTypes = collectRequest.GetObjectTypes(fakeSession);

            Assert.AreSame(sameObjectTypes, ovalObjects, "the objectTypes were loaded again");
        }
        public void Should_be_possible_to_get_objectTypes_from_a_collectRequest()
        {
            IDocumentSession         fakeSession    = this.GetSession();
            CollectRequest           collectRequest = new CollectRequestFactory().CreateCollectRequest(fakeSession).Item2;
            IEnumerable <ObjectType> ovalObjects    = collectRequest.GetObjectTypes(fakeSession);

            Assert.IsNotNull(ovalObjects);
            Assert.IsTrue(ovalObjects.Count() > 0, "the oval object is empty");
            Assert.IsTrue(ovalObjects.Count() == 47, "the oval object count is not expected");
        }
        public void Should_be_possible_to_check_that_all_object_types_is_being_referenced_by_variable()
        {
            var fakeSession    = this.GetSession();
            var collectRequest = new CollectRequestFactory().CreateCollectRequestWithSpecificDefinitions(fakeSession, "public.microsoft.windows.xp_only_objects.xml");

            foreach (var @object in collectRequest.GetObjectTypes(fakeSession))
            {
                try
                {
                    @object.HasReferenceForVariable("");
                }
                catch (Exception ex)
                {
                    Assert.Fail("It was not possible to evaluate {0} type. Error: {1}({2})", @object.ComponentString, ex.Message, ex.GetType().FullName);
                }
            }
        }
 public void Should_raise_an_exception_if_the_list_of_errors_of_the_schema_validation_is_not_empty()
 {
     IDocumentSession         fakeSession    = this.GetSession();
     CollectRequest           collectRequest = new CollectRequestFactory().CreateCollectRequestWithInvalidSchemaDefinitions(fakeSession);
     IEnumerable <ObjectType> ovalObjects    = collectRequest.GetObjectTypes(fakeSession);
 }
 public void Should_raise_an_exception_if_ovalDefinitions_xml_schema_is_invalid()
 {
     IDocumentSession         fakeSession    = this.GetSession();
     CollectRequest           collectRequest = new CollectRequestFactory().CreateCollectRequestWithInvalidDefinitions(fakeSession);
     IEnumerable <ObjectType> ovalObjects    = collectRequest.GetObjectTypes(fakeSession);
 }
Example #6
0
 public void Should_be_possible_to_check_that_all_object_types_is_being_referenced_by_variable()
 {
     var fakeSession = this.GetSession();
     var collectRequest = new CollectRequestFactory().CreateCollectRequestWithSpecificDefinitions(fakeSession, "public.microsoft.windows.xp_only_objects.xml");
     foreach (var @object in collectRequest.GetObjectTypes(fakeSession))
     {
         try
         {
             @object.HasReferenceForVariable("");
         }
         catch (Exception ex)
         {
             Assert.Fail("It was not possible to evaluate {0} type. Error: {1}({2})", @object.ComponentString, ex.Message, ex.GetType().FullName);
         }
     }
 }
Example #7
0
 public void Should_raise_an_exception_if_the_list_of_errors_of_the_schema_validation_is_not_empty()
 {
     IDocumentSession fakeSession = this.GetSession();
     CollectRequest collectRequest = new CollectRequestFactory().CreateCollectRequestWithInvalidSchemaDefinitions(fakeSession);
     IEnumerable<ObjectType> ovalObjects = collectRequest.GetObjectTypes(fakeSession);        
 }
Example #8
0
 public void Should_raise_an_exception_if_ovalDefinitions_xml_schema_is_invalid()
 {
     IDocumentSession fakeSession = this.GetSession();
     CollectRequest collectRequest = new CollectRequestFactory().CreateCollectRequestWithInvalidDefinitions(fakeSession);
     IEnumerable<ObjectType> ovalObjects = collectRequest.GetObjectTypes(fakeSession);
 }
Example #9
0
        public void Should_not_load_the_objectTypes_if_the_objectType_attribute_was_already_set()
        {
            IDocumentSession fakeSession = this.GetSession();
            CollectRequest collectRequest = new CollectRequestFactory().CreateCollectRequest(fakeSession).Item2;
            IEnumerable<ObjectType> ovalObjects = collectRequest.GetObjectTypes(fakeSession); 
            Assert.IsNotNull(ovalObjects);

            IEnumerable<ObjectType> sameObjectTypes = collectRequest.GetObjectTypes(fakeSession);
            Assert.AreSame(sameObjectTypes,ovalObjects, "the objectTypes were loaded again");
            
        }
Example #10
0
 public void Should_be_possible_to_get_objectTypes_from_a_collectRequest()
 {
     IDocumentSession fakeSession = this.GetSession();
     CollectRequest collectRequest = new CollectRequestFactory().CreateCollectRequest(fakeSession).Item2;
     IEnumerable<ObjectType> ovalObjects = collectRequest.GetObjectTypes(fakeSession); 
     Assert.IsNotNull(ovalObjects);
     Assert.IsTrue(ovalObjects.Count() > 0, "the oval object is empty");
     Assert.IsTrue(ovalObjects.Count() == 47, "the oval object count is not expected");
 }