Skip to content

Instantly share code, notes, and snippets.

@analogrelay
Created May 18, 2012 21:51
Show Gist options
  • Save analogrelay/2727787 to your computer and use it in GitHub Desktop.
Save analogrelay/2727787 to your computer and use it in GitHub Desktop.
BadImageFormatException - The signature is incorrect
public interface IConsole {
void WriteLine(string line);
}
public class Test {
[Fact]
public void DoodadWritesToConsole() {
// Arrange
var thingyMock = new Mock<Thingy>();
var doodad = new Doodad(thingyMock.Object);
// Act
doodad.DoAThing(writeToConsole: false);
// Assert
thingyMock.Verify(t => t.MakeConsole(), Times.Never());
}
}
public class Thingy {
public virtual IConsole MakeConsole() { return null; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment