Esempio n. 1
0
        public async Task RefreshProjects_RestartsProjectsListTask()
        {
            var responses = new[]
            {
                new ListProjectsResponse
                {
                    Projects = new List <Project> {
                        s_someProject, s_disabledProject
                    },
                    NextPageToken = null
                },
                new ListProjectsResponse
                {
                    Projects = new List <Project> {
                        s_aProject
                    },
                    NextPageToken = null
                }
            };
            CloudResourceManagerService service = GetMockedService(
                (CloudResourceManagerService s) => s.Projects,
                p => p.List(),
                responses);
            var dataSource = new ResourceManagerDataSource(null, init => service, null);

            dataSource.RefreshProjects();
            IList <Project> projects = await dataSource.ProjectsListTask;

            Assert.AreEqual(1, projects.Count);
            Assert.AreEqual(s_aProject, projects[0]);
        }
Esempio n. 2
0
        public async Task RefreshProjects_RestartsProjectsListTask()
        {
            ListProjectsResponse[] responses =
            {
                new ListProjectsResponse
                {
                    Projects = new List <Project>{
                        s_aProject
                    },
                    NextPageToken = null
                },
                new ListProjectsResponse
                {
                    Projects = new List <Project>{
                        s_someProject, s_disabledProject
                    },
                    NextPageToken = null
                }
            };
            _projectsResourceMock.Request(p => p.List()).ResponseReturns(responses);

            _objectUnderTest.RefreshProjects();
            IList <Project> projects = await _objectUnderTest.ProjectsListTask;

            Assert.AreEqual(1, projects.Count);
            Assert.AreEqual(s_aProject, projects[0]);
        }