public void All_metabase_properties_can_be_null_but_ID()
        {
            var metabaseSession = new MetabaseSessionConfiguration(null, ID_SAMPLE, null, null);

            Assert.IsNull(metabaseSession.Name, "Unexpected metabase name was found.");
            Assert.AreEqual(ID_SAMPLE, metabaseSession.ID, "Unexpected metabase ID was found.");
            Assert.IsNull(metabaseSession.Type, "Unexpected metabase type was found.");
            Assert.IsNull(metabaseSession.UserType, "Unexpected metabase user type was found.");
        }
        public void Should_be_possible_to_represent_metabase_session()
        {
            var metabaseSession = 
                new MetabaseSessionConfiguration(
                    NAME_SAMPLE, ID_SAMPLE, TYPE_SAMPLE, USER_TYPE_SAMPLE);

            Assert.AreEqual(NAME_SAMPLE, metabaseSession.Name, "Unexpected metabase name was found.");
            Assert.AreEqual(ID_SAMPLE, metabaseSession.ID, "Unexpected metabase ID was found.");
            Assert.AreEqual(TYPE_SAMPLE, metabaseSession.Type, "Unexpected metabase type was found.");
            Assert.AreEqual(USER_TYPE_SAMPLE, metabaseSession.UserType, "Unexpected metabase user type was found.");
        }
Esempio n. 3
0
        private bool IsFlaggedProperty(MetabaseSessionConfiguration metabaseSession)
        {
            var propertyID = metabaseSession.ID;

            return(propertyID.Equals("6030") ||
                   propertyID.Equals("6016") ||
                   propertyID.Equals("6000") ||
                   propertyID.Equals("6005") ||
                   propertyID.Equals("4013") ||
                   propertyID.Equals("2068") ||
                   propertyID.Equals("6031") ||
                   propertyID.Equals("2044") ||
                   propertyID.Equals("1027") ||
                   propertyID.Equals("7044") ||
                   propertyID.Equals("9037")

                   );
        }
Esempio n. 4
0
        private void CheckFlaggedProperties(MetabaseSessionConfiguration metabaseSession)
        {
            if (string.IsNullOrWhiteSpace(metabaseSession.Value))
                return;

            if (this.IsFlaggedProperty(metabaseSession))
            {
                int propertyValue = 0;
                var flags = metabaseSession.Value.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var flag in flags)
                {
                    var xPathFlagNode =  string.Format("//*[@InternalName='{0}']", flag.Trim());
                    var flagNode = new XPathOperator().applyXpath(this.XmlMBSchema, xPathFlagNode, true);
                    var flagValue = int.Parse(new XPathOperator().applyXpath(flagNode.First(), "//*/@Value", false).First());
                    propertyValue += flagValue;
                }

                metabaseSession.Value = propertyValue.ToString();
            }
        }
Esempio n. 5
0
        private void CheckFlaggedProperties(MetabaseSessionConfiguration metabaseSession)
        {
            if (string.IsNullOrWhiteSpace(metabaseSession.Value))
            {
                return;
            }

            if (this.IsFlaggedProperty(metabaseSession))
            {
                int propertyValue = 0;
                var flags         = metabaseSession.Value.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var flag in flags)
                {
                    var xPathFlagNode = string.Format("//*[@InternalName='{0}']", flag.Trim());
                    var flagNode      = new XPathOperator().applyXpath(this.XmlMBSchema, xPathFlagNode, true);
                    var flagValue     = int.Parse(new XPathOperator().applyXpath(flagNode.First(), "//*/@Value", false).First());
                    propertyValue += flagValue;
                }

                metabaseSession.Value = propertyValue.ToString();
            }
        }
Esempio n. 6
0
        private bool IsFlaggedProperty(MetabaseSessionConfiguration metabaseSession)
        {
            var propertyID = metabaseSession.ID;

            return (propertyID.Equals("6030") ||
                    propertyID.Equals("6016") ||
                    propertyID.Equals("6000") ||
                    propertyID.Equals("6005") ||
                    propertyID.Equals("4013") ||
                    propertyID.Equals("2068") ||
                    propertyID.Equals("6031") ||
                    propertyID.Equals("2044") ||
                    propertyID.Equals("1027") ||
                    propertyID.Equals("7044") ||
                    propertyID.Equals("9037")
                    
                    );
        }