Services() 공개 메소드

public Services ( string args, System.Guid workspaceId, System.Guid dataListId ) : ResourceList
args string
workspaceId System.Guid
dataListId System.Guid
리턴 ResourceList
예제 #1
0
 public void ServicesWithInvalidArgsExpectedReturnsEmptyList()
 {
     var resources = new Resources();
     var result = resources.Services("xxxx", Guid.Empty, Guid.Empty);
     Assert.AreEqual(0, result.Count);
 }
예제 #2
0
        public void ServicesWithValidArgsExpectedReturnsList()
        {
            var workspaceID = Guid.NewGuid();
            var workspacePath = EnvironmentVariables.GetWorkspacePath(workspaceID);
            try
            {
                const int Modulo = 2;
                const int ExpectedCount = 6;
                for(var i = 0; i < ExpectedCount; i++)
                {
                    var resource = new Resource
                    {
                        ResourceID = Guid.NewGuid(),
                        ResourcePath = (i % Modulo == 0) ? ResourceType.WorkflowService + "\\" + string.Format("My Name {0}", i) : string.Format("My Name {0}", i),
                        ResourceName = string.Format("My Name {0}", i),
                        ResourceType = (i % Modulo == 0) ? ResourceType.WorkflowService : ResourceType.Unknown
                    };
                    ResourceCatalog.Instance.SaveResource(workspaceID, resource);
                }
                var resources = new Resources();
                var result = resources.Services(ResourceType.WorkflowService.ToString(), workspaceID, Guid.Empty);

                Assert.AreEqual(ExpectedCount / Modulo, result.Count);
            }
            finally
            {
                if(Directory.Exists(workspacePath))
                {
                    DirectoryHelper.CleanUp(workspacePath);
                }
            }
        }