Skip to content

Create SMO samples project#558

Merged
uc-msft merged 5 commits intomicrosoft:masterfrom
shueybubbles:master
May 14, 2019
Merged

Create SMO samples project#558
uc-msft merged 5 commits intomicrosoft:masterfrom
shueybubbles:master

Conversation

@shueybubbles
Copy link
Copy Markdown
Contributor

I am going to add more snippets-as-unit-tests to this project over time. There have been a fair number of SMO API enhancements the past few years and we are somewhat lacking in documentation. As more devs are trying to write performant apps on top of SMO we need to have better examples on how to use SMO effectively.
I've chosen to experiment with using the unit test format for samples so the assertions provide both documentation and clear description of what benefits the code techniques provide. I welcome input on how to structure the sample and on what kinds of samples to add.

shueybubbles and others added 2 commits April 30, 2019 23:21
pull latest from Microsoft/sql-server-samples
* initial SMO sample skeleton project

* add linux test runner

* change namepsace

* add Urn tests

* Complete the collection sample

* fix a comment
@shueybubbles
Copy link
Copy Markdown
Contributor Author

Is there a way I can create branches in the Microsoft/sql-server-samples repo instead of forking it? I got some kind of permissions problem when I tried.

Comment thread samples/features/sql-management-objects/README.md Outdated
Comment thread samples/features/sql-management-objects/README.md Outdated

### Contents

[About this sample](#about-this-sample)<br/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: The
's are unnecessary

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can you elaborate? I don't see any 's

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

haha, whoops.

<br />'s is what I meant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh it's from the template

Comment thread samples/features/sql-management-objects/prep/restore.sh
Comment thread samples/features/sql-management-objects/src/CollectionSamples.cs
Comment thread samples/features/sql-management-objects/src/CollectionSamples.cs
Comment thread samples/features/sql-management-objects/src/ConnectionHelpers.cs Outdated
public VisualStudio.TestTools.UnitTesting.TestContext TestContext { get; set; }

[TestMethod]
public void Collection_iteration_is_faster_with_SetDefaultInitFields()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So overall I like the idea of having actual examples users can run to see the benefits. But it'd definitely be great to also explain how this is actionable for them - ideally every test would have an explanation of what it's demonstrating and how users could use it in their own code.

Comment thread samples/features/sql-management-objects/src/ConnectionHelpers.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants