public void SetInputPropertyValue_NullProperty()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            // Action
            SmartObjectExtensions.SetInputPropertyValue(smartObject, null, null);
        }
        public void GetReturnProperties_NullMethod()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            // Action
            SmartObjectExtensions.GetReturnProperties(smartObject);
        }
        public void GetPropertyValue_NullPropertyName()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            // Action
            SmartObjectExtensions.GetPropertyValue <string>(smartObject, null);
        }
        public void GetPropertyValue_InvalidProperty()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            smartObject.MethodToExecute = smartObject.ListMethods[0].Name;

            // Action
            SmartObjectExtensions.GetPropertyValue <int>(smartObject, Guid.NewGuid().ToString());
        }
        public void AddPropertyOrderBy_WithValidSmartObject()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            smartObject.MethodToExecute = smartObject.ListMethods[0].Name;

            // Action
            SmartObjectExtensions.AddPropertyOrderBy(smartObject, smartObject.ListMethods[0].ReturnProperties[0].Name);
        }
        public void SetNewMethod_WithValidSmartObject()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.Users_and_Groups);

            smartObject.MethodToExecute = smartObject.ListMethods[0].Name;

            // Action
            SmartObjectExtensions.SetNewMethod(smartObject, smartObject.ListMethods[0].Name, false, true);
        }
        public void SetInputPropertyValue_NoMethodToExecute()
        {
            //Arrange
            var smartObject  = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);
            var propertyName = Guid.NewGuid().ToString();
            var value        = Guid.NewGuid().ToString();

            // Action
            SmartObjectExtensions.SetInputPropertyValue(smartObject, propertyName, value);
        }
        public void GetReturnProperty_WithNullProperty()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            smartObject.MethodToExecute = smartObject.ListMethods[0].Name;

            // Action
            SmartObjectExtensions.GetReturnProperty(smartObject, null);
        }
        public void GetReturnProperty_WithNoReturnProperties()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.NoReturnProperties);

            smartObject.MethodToExecute = smartObject.AllMethods.First().Name;

            // Action
            SmartObjectExtensions.GetReturnProperty(smartObject, Guid.NewGuid().ToString());
        }
        public void SetFilter_WithValidSmartObject()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            smartObject.MethodToExecute = smartObject.ListMethods[0].Name;

            var filter = Mock.Of <Equals>();

            // Action
            SmartObjectExtensions.SetFilter(smartObject, filter);
        }
        public void GetPropertyValue_EmptyValue()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            smartObject.MethodToExecute = smartObject.ListMethods[0].Name;

            // Action
            var actual = SmartObjectExtensions.GetPropertyValue <int>(smartObject, smartObject.ListMethods[0].ReturnProperties[0].Name);

            // Assert
            Assert.AreEqual(0, actual);
        }
        public void GetPropertyValue_ValidCast()
        {
            //Arrange
            var expected    = Guid.NewGuid().ToString();
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            smartObject.MethodToExecute = smartObject.ListMethods[0].Name;
            smartObject.Properties[smartObject.ListMethods[0].ReturnProperties[0].Name].Value = expected;

            // Action
            var actual = SmartObjectExtensions.GetPropertyValue <string>(smartObject, smartObject.ListMethods[0].ReturnProperties[0].Name);

            // Assert
            Assert.AreEqual(expected, actual);
        }
        public void ToList_WithValidSmartObjectList()
        {
            //Arrange
            var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo);

            smartObject.MethodToExecute = smartObject.ListMethods[0].Name;

            var smartObjectList = new SmartObjectList();

            smartObjectList.SmartObjectsList.Add(smartObject);

            // Action
            var actual = SmartObjectExtensions.ToList(smartObjectList, smartObject.MethodToExecute);

            // Assert
            Assert.AreEqual(1, actual.Count());
        }
 public void SetInputPropertyValue_NullSmartObject()
 {
     // Action
     SmartObjectExtensions.SetInputPropertyValue(null, null, null);
 }
 public void GetReturnProperties_NullSmartObject()
 {
     // Action
     SmartObjectExtensions.GetReturnProperties(null);
 }