public void SetUp()
        {
            viewMock = new Mock<IDecompressionView>();
            fileWrapperMock = new Mock<IFileWrapper>();
            fileWrapperMock.Setup(f => f.FileExists(It.IsAny<string>())).Returns(true);
            fileWrapperMock.Setup(f => f.OpenRead(It.IsAny<string>())).Returns(new MemoryStream());

            decoderMock = new Mock<IDecoder>();
            decoderFactoryMock = new Mock<IDecoderFactory>();
            decoderFactoryMock
                .Setup(df => df.CreateDecoder(It.IsAny<Stream>(), It.IsAny<Stream>()))
                .Returns(decoderMock.Object);
            target = new DecompressionPresenter(fileWrapperMock.Object, decoderFactoryMock.Object)
            {
                View = viewMock.Object
            };
        }
Exemplo n.º 2
0
 public DecompressionView(PresenterFactory presenterFactory)
 {
     presenter = presenterFactory.CreateDecompressionPresenter(this);
 }