I am trying to make Moq and I am stuck in a very simple example. I want to make fun of the very simple IInput interface:
namespace Example { public interface IInput { int SomeProperty { get; set; } } }
This seems like a very simple task. However, I get a compilation error when I try to make fun of it in the following test code:
using Moq; using NUnit.Framework; namespace FirstEniro._Test { [TestFixture] class TestFirstClass { [Test] public void TestConstructionOk() { var mock = new Mock<IInput>(); mock.Setup(r => r.SomeProperty).Returns(3); var x = new FirstClass(mock); Assert.That(x, Is.EqualTo(3)); } } }
The compiler says: βIt is not possible to convert from Moq.Mock<Example.IInput> to <Example.IInput> . I donβt see what I'm doing wrong. Please help me
source share