public void BooleanType() { XrmFakedContext fakedContext = SupportMethods.SetupPrimitiveFakedService( SupportMethods.ThemeLogicalName, SupportMethods.ThemeDisplayName, SupportMethods.GetBooleanTypeEntity()); IOrganizationService fakedService = fakedContext.GetOrganizationService(); DataBuilder DataBuilder = new DataBuilder(fakedService); DataBuilder.AppendData(SupportMethods.GetBooleanTypeFetch()); Assert.AreEqual( DataBuilder.BuildDataXML().InnerXml, SupportMethods.GetBooleanTypeExpectedData()); }
public void NoData_ReturnsValidSchemaXML() { XrmFakedContext fakedContext = SupportMethods.SetupPrimitiveFakedService( SupportMethods.ThemeLogicalName, SupportMethods.ThemeDisplayName, SupportMethods.GetBooleanTypeEntity()); IOrganizationService fakedService = fakedContext.GetOrganizationService(); DataBuilder DataBuilder = new DataBuilder(fakedService); DataBuilder.AppendData("<fetch><entity name='systemuser'></entity></fetch>"); Assert.AreEqual( DataBuilder.BuildSchemaXML().InnerXml, "<entities />"); }
public void BooleanType() { XrmFakedContext fakedContext = SupportMethods.SetupPrimitiveFakedService( SupportMethods.ThemeLogicalName, SupportMethods.ThemeDisplayName, SupportMethods.GetBooleanTypeEntity()); fakedContext.AddExecutionMock <RetrieveEntityRequest>(req => { var entityMetadata = fakedContext.GetEntityMetadataByName(SupportMethods.ThemeLogicalName); entityMetadata.DisplayName = new Label(SupportMethods.ThemeDisplayName, 1033); entityMetadata.SetSealedPropertyValue("PrimaryNameAttribute", "name"); entityMetadata.Attributes.First(a => a.LogicalName == "isdefaulttheme").SetSealedPropertyValue("DisplayName", new Label("Default Theme", 1033)); entityMetadata.Attributes.First(a => a.LogicalName == "themeid").SetSealedPropertyValue("DisplayName", new Label("Theme", 1033)); var response = new RetrieveEntityResponse() { Results = new ParameterCollection { { "EntityMetadata", entityMetadata } } }; return(response); }); IOrganizationService fakedService = fakedContext.GetOrganizationService(); DataBuilder DataBuilder = new DataBuilder(fakedService); DataBuilder.AppendData(SupportMethods.GetBooleanTypeFetch_TopIsOne()); String DataBuilderXML = DataBuilder.BuildSchemaXML().InnerXml; String RealXml = SupportMethods.GetBooleanTypeExpectedSchema(); Assert.AreEqual( DataBuilder.BuildSchemaXML().InnerXml, SupportMethods.GetBooleanTypeExpectedSchema()); }