SpecFlow: XSDs

I didn’t get very far with this, just the screenshots:

AppConfig01

AppConfig02

AppConfig03

AppConfig04

AppConfig05 AppConfig06

AppConfig07

AppConfig08

AppConfig09

AppConfig10

AppConfig11

Advertisements

Visual Studio 2015: SpecFlow

Dunno why, but installing SpecFlow in Package Manager console works… but then I can’t find the items.

So going here, gives you this:

SFlowDownload01

Same how-tos here and page dedicated to 2015 here.

Install it…

SFlowDownload02

Then when you stop and start VS, you get this:

SFlowDownload03

I had already created a MSTest project inside a console application solution. Before I didn’t have the SpecFlow items, now I do, when I go to add an item:

SFlowDownload04

The first time of asking, we get this:

SFlowDownload05

SFlowDownload06

So easy enough to resolve the SpecFlow reference, now just the NUnit.

This is the app.config for the other project (sic):

SFlowDownload07

And I’ve seen comments saying that you need this line (first for context):

<specFlow>
      <unitTestProvider name="MsTest.2010" />

I dragged the updated app.config into the Unit Test Project, thus…

SFlowDownload08

SFlowDownload09

Also note that the generated file now contains MSTest references, not NUnit references, since we have the new entry in the app.config (the squiggles are because it can’t find a schema for SpecFlow:

SFlowDownload10

Perhaps now I can get to the error I was trying to demonstrate. Oh but first I have to give it some bindings:

SFlowDownload11

So now we have that (PasteBin here)…

SFlowDownload12

Then the test passes…

SFlowDownload13

And then I was playing with the tags trying to get it to break with this error re ScenarioContext and missing key… but I can’t now (get it to break).

Visual Studio: code snippets

As at work we might stop using ReSharper, I’ll assume that and come back to how you do Code Snippets, Visual Studio-style.

There’s this from MSDN which shows you how to create one.

This is how you can use it of course: you start to type letters and after some pre-defined pause it assumes you want to see the snippet library, in this case for all snippets starting with [p]:

VSSnippets01

Where has this come from?

VSSnippets02

VSSnippets03

Now interesting here is that e.g. the [propa] and [propdp] snippets are not in that list, so presumably it at least aggregates from a few different sources under the [C:\Program Files (x86)\Microsoft Visual Studio 14.0] area. So if I do try to find e.g. propdp,

VSSnippets05

, which expands to this promising code:VSSnippets04

I need to know the location and extension of a snippet, so from the Manager, I can get the location, giving this:

VSSnippets06

Notice that [Snippets] is below [VC#], rather than the other way round, which seems a bit mad to me. Regardless,I now know where to look for the propdp snippet:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC#\Snippets\1033\NetFX30

VSSnippets09

VSSnippets08

So that too is under the VC# umbrella, so maybe it is just grouping the C# bits together.

More MSDN [List of common C# snippets (.e.g. for properties)] [Create a New Snippet with Replacements] [Distribute Code Snippets]

Now my pet rant on C# code snippets vs ReSharper was the fact that you can’t do any on-the-fly substitution (see my YouTube elsewhere on what I mean by that) on macro variables. Fine, with a few extra keystrokes, you can achieve the necessary with the standard snippet [propfull]:

PropFull01 PropFull02

and in simple uses, this is probably enough (propg):

Propg01

Might be helpful to show what underpins the fuller one, propfull:

snippett01

Code

Visual Studio: diagnostics

I am a fan of the debugger in Visual Studio. For a number of years now, I have seen the Intellitrace window appear more as an irritant… because I knew nothing about it. So today I took the trouble to watch the VS-embedded video on this. And it sounds promising, particularly the ability to run Intellitrace on a machine that does not have VS, and to collect the data for subsequent analysis on a machine that does.

The diagnostics section of the MSDN blog:

Channel 9 Visual Studio videos, including the Intellitrace one.

Chef: more

If I try to apply an example from the bottom of this page… then it’s pretty clear this content will not fly on Windows (but will of course on Unix/Linux). But it’s still interesting to see errors. I’ll include this in a .rb file..

file 'C:\temp\settings.ini' do
  owner 'root'
  group 'root'
  mode '0755'
  action :create
end

, and then run it:
ChefError01

No mapping between account names and security IDs was done.

OK, so I've played with some permutations on this, and I see that this  works:

DenChefOwner01 DenChefOwner02
, and if I deliberately give it a bad owner, then more or less we get this again:

ChefError01

so the catch-all for bad anything almost is the "Mapping" exception. So we'll back in the valid user and make them the Group as well, just as a quck test:
ChefUser01 ChefUser02


That is ok, so now let's apply the group and user exactly as they are in Computer Management:

ChefUser03 ChefUser04
Enough for now.

.

.