public void Given_WebActivityBackedByAModelItem_ExpectedTheServiceNamePropertySetsTheServiceNamePropertyOnTheModelItem()
        {
            DsfActivity Act = new DsfActivity();

            Act.ServiceName   = "testResource";
            Act.InputMapping  = @"<Inputs><Input Name=""Host"" Source=""Host"" DefaultValue=""mail.bellevuenet.co.za""><Validator Type=""Required"" /></Input><Input Name=""Port"" Source=""Port"" DefaultValue=""25""><Validator Type=""Required"" /></Input><Input Name=""From"" Source=""From"" DefaultValue=""*****@*****.**""><Validator Type=""Required"" /></Input><Input Name=""To"" Source=""To""><Validator Type=""Required"" /></Input><Input Name=""Subject"" Source=""Subject""><Validator Type=""Required"" /></Input><Input Name=""BodyType"" Source=""Bodytype"" DefaultValue=""html""><Validator Type=""Required"" /></Input><Input Name=""Body"" Source=""Body""><Validator Type=""Required"" /></Input><Input Name=""Attachment"" Source=""Attachment"" DefaultValue=""NONE""><Validator Type=""Required"" /></Input></Inputs>";
            Act.OutputMapping = @"<Outputs><Output Name=""FailureMessage"" MapsTo=""FailureMessage"" Value=""[[FailureMessage]]"" /><Output Name=""Message"" MapsTo=""Message"" Value=""[[Message]]"" /></Outputs>";
            ModelItem testItem = TestModelItemFactory.CreateModelItem(Act);

            string serviceName = "cake";

            IWebActivity webActivity = WebActivityFactory.CreateWebActivity(testItem, null, serviceName);

            Assert.AreEqual(serviceName, webActivity.ServiceName);
            Assert.AreEqual("DsfActivity", ModelItemUtils.GetProperty("DisplayName", testItem));
        }
        public void WebActivity_IsConnected_PassThrough(bool retConnected, bool retLoaded, bool expected)
        {
            DsfActivity Act = new DsfActivity();

            Act.ServiceName   = "testResource";
            Act.InputMapping  = @"<Inputs><Input Name=""Host"" Source=""Host"" DefaultValue=""mail.bellevuenet.co.za""><Validator Type=""Required"" /></Input><Input Name=""Port"" Source=""Port"" DefaultValue=""25""><Validator Type=""Required"" /></Input><Input Name=""From"" Source=""From"" DefaultValue=""*****@*****.**""><Validator Type=""Required"" /></Input><Input Name=""To"" Source=""To""><Validator Type=""Required"" /></Input><Input Name=""Subject"" Source=""Subject""><Validator Type=""Required"" /></Input><Input Name=""BodyType"" Source=""Bodytype"" DefaultValue=""html""><Validator Type=""Required"" /></Input><Input Name=""Body"" Source=""Body""><Validator Type=""Required"" /></Input><Input Name=""Attachment"" Source=""Attachment"" DefaultValue=""NONE""><Validator Type=""Required"" /></Input></Inputs>";
            Act.OutputMapping = @"<Outputs><Output Name=""FailureMessage"" MapsTo=""FailureMessage"" Value=""[[FailureMessage]]"" /><Output Name=""Message"" MapsTo=""Message"" Value=""[[Message]]"" /></Outputs>";
            ModelItem testItem = TestModelItemFactory.CreateModelItem(Act);
            var       resource = new Mock <IContextualResourceModel>();
            var       env      = new Mock <IEnvironmentModel>();

            resource.Setup(a => a.Environment).Returns(env.Object);
            env.Setup(a => a.IsConnected).Returns(retConnected);
            env.Setup(a => a.HasLoadedResources).Returns(retLoaded);
            string serviceName = "cake";

            IWebActivity webActivity = WebActivityFactory.CreateWebActivity(testItem, resource.Object, serviceName);

            Assert.AreEqual(expected, webActivity.IsNotAvailable());
        }