Hi! I'm starting to use Moq and I cannot figure out how to test the method Execute in the code below:
I have the following class:
public class MyObject {
private IDataReaderPlugin m_source;
private IDataWriterPlugin m_dest;
private string[] m_dummyTags = new string[] { "tag1", "tag2", "tag3"};
public void Execute(DateTime time)
{
DataCollection tags = m_source.SnapshotUtc(m_dummyTags, time);
//Doing some treatment on the values in tags
m_dest.Write(tags);
}
}
Another method is responsible to create and initialize IDataReaderPlugin and IDataWriterPlugin from information in a configuration file.
I want to test the method Execute. So, I need to mock m_source and m_dest and after I want to test the result sent to m_dest.
How I can achieve this with Moq?
Thanks.