Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VSI tests for Navigation Bars #18478

Merged
merged 5 commits into from
Apr 6, 2017
Merged

Conversation

rchande
Copy link
Contributor

@rchande rchande commented Apr 5, 2017

Tag @dotnet/roslyn-ide for review

int Foo() { }
void Bar() { }
}");
VisualStudio.Editor.PlaceCaret("this", charsOffset: 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Did something happen to SetUpEditor?

}");
VisualStudio.Editor.PlaceCaret("this", charsOffset: 1);
VisualStudio.Workspace.WaitForAsyncOperations(FeatureAttribute.NavigationBar);
VisualStudio.Editor.ExpandRightNavBar();
Copy link
Contributor

Choose a reason for hiding this comment

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

Stupid question, but shouldn't expanding the nav bar block until it's ready anyway?

VisualStudio.Editor.SelectRightNavBarItem("operator !=(C c1, C c2)");
VisualStudio.Workspace.WaitForAsyncOperations(FeatureAttribute.NavigationBar);

VisualStudio.Editor.Verify.CaretPosition(205);
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 you can do VerifyCurrentLine and include a $$ to denote the caret position instead of setting a huge incomprehensible number.

}

[Fact, Trait(Traits.Feature, Traits.Features.NavigationBar)]
public void VerifyNavBar()
Copy link
Contributor

Choose a reason for hiding this comment

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

This one test tests a lot of stuff.

@@ -0,0 +1,147 @@
using System;
Copy link
Contributor

Choose a reason for hiding this comment

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

Copyright

Copy link
Contributor

Choose a reason for hiding this comment

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

And maybe unused usings?

}

ExpandNavigationBar(comboboxIndex);
System.Windows.Forms.SendKeys.SendWait("{HOME}");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this how we have to SendKeys now?

Copy link
Member

Choose a reason for hiding this comment

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

@dpoeschl No, we should be using our own helper here. Why the use of this here @rchande?

}

var topMarginControl = control.GetPropertyValue<ContentControl>("TopMarginControl");
UIElement vsDropDownBarAdapterMargin = topMarginControl.Content as UIElement;
Copy link
Contributor

Choose a reason for hiding this comment

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

var

}
}

static class Extensions
Copy link
Contributor

Choose a reason for hiding this comment

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

explicit accessibility

Copy link
Contributor

Choose a reason for hiding this comment

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

better name? These are a bunch of reflection helpers, so maybe ReflectionExtensions? Or just ReflectionHelpers without the extension method part.

@@ -169,5 +169,44 @@ public void WaitForActiveView(string viewName)

public string[] GetErrorTags()
=> _editorInProc.GetErrorTags();

public void ExpandProjectNavBar()
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 our opportunity to call them something better than "Project/Left/Right" here, since the "Left/Right" part is named that way for legacy reasons, and "Left" actually means "Middle". Project/Type/Member?

@rchande
Copy link
Contributor Author

rchande commented Apr 5, 2017

Thanks @dpoeschl. I've incorporated your feedback.

@rchande
Copy link
Contributor Author

rchande commented Apr 6, 2017

retest windows_release_vs-integration_prtest

@rchande
Copy link
Contributor Author

rchande commented Apr 6, 2017

retest windows_debug_vs-integration_prtest

@rchande
Copy link
Contributor Author

rchande commented Apr 6, 2017

retest windows_release_vs-integration_prtest

@rchande rchande merged commit 9616765 into dotnet:master Apr 6, 2017
@rchande rchande deleted the navigationBarTest branch April 6, 2017 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants