public void GetPowerBIDataflowOrganizationScope_ListParameterSet() { // Arrange var expectedDataflows = new List <Dataflow> { new Dataflow { Id = Guid.NewGuid(), Name = "TestDataflow1" }, new Dataflow { Id = Guid.NewGuid(), Name = "TestDataflow2" } }; var client = new Mock <IPowerBIApiClient>(); client.Setup(x => x.Dataflows.GetDataflowsAsAdmin(null, null, null)).Returns(expectedDataflows); var initFactory = new TestPowerBICmdletInitFactory(client.Object); var cmdlet = new GetPowerBIDataflow(initFactory) { Scope = PowerBIUserScope.Organization, ParameterSet = "List", }; // Act cmdlet.InvokePowerBICmdlet(); // Assert initFactory.AssertExpectedUnitTestResults(expectedDataflows); }
public void GetPowerBIDataflowIndividualScope_ListParameterSet() { // Arrange var expectedDataflows = new List <Dataflow> { new Dataflow { Id = Guid.NewGuid(), Name = "TestDataflow1" }, new Dataflow { Id = Guid.NewGuid(), Name = "TestDataflow2" } }; var workspaceId = Guid.NewGuid(); var client = new Mock <IPowerBIApiClient>(); client.Setup(x => x.Dataflows.GetDataflows(workspaceId)).Returns(expectedDataflows); var initFactory = new TestPowerBICmdletInitFactory(client.Object); var cmdlet = new GetPowerBIDataflow(initFactory) { Scope = PowerBIUserScope.Individual, ParameterSet = "List", WorkspaceId = workspaceId }; // Act cmdlet.InvokePowerBICmdlet(); // Assert initFactory.AssertExpectedUnitTestResults(expectedDataflows); }