Send mail to the author(s) E-mail

# Friday, 29 May 2015

To get XUnit2 working with AutoFixture using R# test runner:

Run powershell as administrator: Set-ExecutionPolicy RemoteSigned

Install-Package AutoFixture.XUnit2   **be careful not to install AutoFixture.Xunit
(This installs AutoFixture and XUnit2)

Install-Package xunit.runner.visualstudio
(Test runner for xunit)

Install-Package xunit

| | # 
# Thursday, 28 May 2015

I like the concept behind Maybe<T>..  Option Type in functional programming. 

  • List/Collection of 0 or 1 elements
  • eg if a TextFileRead operation is legal it returns the contents of the file as 1 element
  • eg if a TextFileRead operation fails it returns 0 elements

[Theory, AutoData] //[Theory] //[InlineData("test message")] public void ReadReturnsMessage(string message) { var fileStore = new FileStore(Environment.CurrentDirectory); fileStore.Save(44, message); Maybe<string> actual = fileStore.Read(44); Assert.Equal(message, actual.Single()); }

To get these tests to run, I had to install: (commented out text above shows how to run it not using AutoFixture) – not version 2 – not version 2 – used latest – used latest

AutoFixture puts in random data into the string message.

Also found I had to use R#9 to get xunit2 runner working (although using xunit1 now)

| | #