示例#1
0
        public static bool ContainsExpectedStartMenu(List<StartMenuApplication> expectedResult, StartMenuApplication actual)
        {
            bool isIdentical = false;

            foreach (StartMenuApplication expected in expectedResult)
            {
                isIdentical = expected.Name == actual.Name;
                isIdentical &= expected.StartMenuAppId == actual.StartMenuAppId;
                isIdentical &= expected.VirtualPath == actual.VirtualPath;
                isIdentical &= expected.CommandLineArguments == actual.CommandLineArguments;
                isIdentical &= expected.IconUri == actual.IconUri;

                if (isIdentical)
                {
                    break;
                }
            }

            return isIdentical;
        }
示例#2
0
        public static int SetUpDefaultRemoteAppStartMenu(Mock<IRemoteAppManagementClient> clientMock, string collectionName)
        {
            ISetup<IRemoteAppManagementClient, Task<GetStartMenuApplicationListResult>> setup = null;

            GetStartMenuApplicationListResult response = new GetStartMenuApplicationListResult()
            {
                RequestId = "122-13342",
                StatusCode = System.Net.HttpStatusCode.OK
            };

            response.ResultList = new List<StartMenuApplication>()
            {
                new StartMenuApplication()
                {
                    Name = "Mohoro RemoteApp1",
                    StartMenuAppId = "1",
                    VirtualPath = @"C:\Application\RemoteApp1.exe",
                    CommandLineArguments = "Arg1, Arg2, Arg3",
                    IconUri =  @"C:\Application\RemoteApp1.exe",
                },
                new StartMenuApplication()
                {
                    Name = "Mohoro RemoteApp2",
                    StartMenuAppId = "2",
                    VirtualPath = @"C:\Application\RemoteApp2.exe",
                    CommandLineArguments = "1, 86, 42",
                    IconUri = @"C:\Application\RemoteApp2.exe",
                }
            };

            mockStartMenuList = new List<StartMenuApplication>();
            foreach (StartMenuApplication app in response.ResultList)
            {
                StartMenuApplication mockApp = new StartMenuApplication()
                {
                    Name = app.Name,
                    StartMenuAppId = app.StartMenuAppId,
                    VirtualPath = app.VirtualPath,
                    CommandLineArguments = app.CommandLineArguments,
                    IconUri = app.IconUri
                };
                mockStartMenuList.Add(mockApp);
            }

            setup = clientMock.Setup(c => c.Publishing.StartMenuApplicationListAsync(collectionName, It.IsAny<CancellationToken>()));
            setup.Returns(Task.Factory.StartNew(() => response));

            return mockStartMenuList.Count;
        }