Last active
September 28, 2019 16:53
-
-
Save francipvb/8fa271ed1256a14c610b4af3ab0c3e3d to your computer and use it in GitHub Desktop.
Just a little Moq demonstration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Moq; | |
using Xunit; | |
namespace GithubGists | |
{ | |
public class MockGist | |
{ | |
[Fact] | |
public void TestMock() | |
{ | |
// Note this conditional expression... | |
var foo = Mock.Of<IFoo>(f => f.Foo == "foo"); | |
Assert.Equal("foo", foo.Foo); | |
} | |
} | |
public interface IFoo | |
{ | |
string Foo { get; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment