Skip to content

Conversation

@CodeCyclone
Copy link
Collaborator

@CodeCyclone CodeCyclone added bug Something isn't working enhancement New feature or request labels Jun 27, 2018
Copy link
Contributor

@nandemoii nandemoii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these changes fix bugs, I would expect to see unit tests added.

### -Scope
Indicates scope of the call. Individual returns only datasets assigned to the caller; Organization returns all datasets within a tenant (must be an administrator to initiate). Individual is the default.
Indicates scope of the call. Individual returns datasets from "My Workspace" unless -Workspace or -WorkspaceId is specified which shows datasets under the workspace assigned to the caller; Organization returns all datasets within a tenant (must be an administrator to initiate). Individual is the default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusingly worded. Is this true to what you had in mind?
Indicates scope of the call. Individual returns datasets from "My Workspace" by default. Using the -Workspace or -WorkspaceId parameter, you can show datasets from any workspace assigned to the caller.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to change it to this:
Indicates scope of the call. Individual returns datasets from "My Workspace" by default. With -Workspace or -WorkspaceId, datasets under the workspace assigned to the caller are returned; Organization returns all datasets within a tenant (must be an administrator to initiate). Individual is the default.

* Added dataset non-interactive test
* Added interactive piping dataset to get datasource
* Adeed non-interactive of getting datasource from dataset object
* Added non-interactive  test for Connect-PowerBIServiceAccount with -Tenant
/*
* Requirement to run test:
* Need at least one dataset containing a datasource assigned to the user logging into the test.
* Update the test with the dataset ID before running.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should consider updating this and other tests to act similar to the end-to-end tests for the workspace cmdlets.

Those tests don't require you to update the test with any specific ID because they attempt to locate the first valid workspace using a shared helper method (that calls the get cmdlet). If no valid workspace is found, it returns inconclusive. After this check, it will run the intended cmdlets using the ID or workspace object.

This flow makes it very simple to run the end-to-end tests locally and figure out which scenarios weren't hit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

public TestPowerBICmdletNoClientInitFactory(bool setProfile, IPowerBIProfile profile = null) :
base(new TestLoggerFactory(), new ModuleDataStorage(), new TestAuthenticator(), new PowerBISettings())
{
if(setProfile)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be helpful to add a comment explaining the intended test scenarios that this boolean parameter allows you to exercise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added doc

// Assert
TestUtilities.AssertNoCmdletErrors(ps);
Assert.IsNotNull(results);
Assert.IsTrue(results.Count > 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using Linq (results.Any()) and possibly asserting inconclusive if no results are found.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@CodeCyclone CodeCyclone merged commit b37a403 into dev Jun 28, 2018
@CodeCyclone CodeCyclone deleted the cyclone/Improvements branch June 28, 2018 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants