Get() public method

public Get ( string resourceId, System.Guid workspaceId, System.Guid dataListId ) : WebSource
resourceId string
workspaceId System.Guid
dataListId System.Guid
return Dev2.Runtime.ServiceModel.Data.WebSource
Esempio n. 1
0
        public void WebSourcesGetWithValidArgsExpectedReturnsSource()
        {
            var expected = CreateWebSource();
            var saveArgs = expected.ToString();

            var workspaceID = Guid.NewGuid();
            var workspacePath = EnvironmentVariables.GetWorkspacePath(workspaceID);
            try
            {
                var handler = new WebSources();
                handler.Save(saveArgs, workspaceID, Guid.Empty);

                var actual = handler.Get(expected.ResourceID.ToString(), workspaceID, Guid.Empty);

                VerifySource(actual, expected);
            }
            finally
            {
                try
                {
                    if(Directory.Exists(workspacePath))
                    {
                        DirectoryHelper.CleanUp(workspacePath);
                    }
                }
                // ReSharper disable EmptyGeneralCatchClause
                catch(Exception)
                // ReSharper restore EmptyGeneralCatchClause
                {
                }
            }
        }
Esempio n. 2
0
        public void WebSourcesGetWithInvalidArgsExpectedReturnsNewSource()
        {
            var handler = new WebSources();
            var result = handler.Get("xxxxx", Guid.Empty, Guid.Empty);

            Assert.IsNotNull(result);
            Assert.AreEqual(Guid.Empty, result.ResourceID);
        }