Exemplo n.º 1
0
        public void SetUp()
        {
            _fixture            = new Fixture();
            _uniqueNameCreator  = new Mock <IFileNameCreator>();
            _uriCreator         = new Mock <IUriCreator>();
            _filesystemResolver = new Mock <IEnchiladaFilesystemResolver>();

            _enchiladaMessageDataRepository = new EnchiladaMessageDataRepository(_filesystemResolver.Object, _uniqueNameCreator.Object, _uriCreator.Object);
        }
        public void ShouldReturnRepository()
        {
            var adapterName = _fixture.Create("name");
            var adapter     = new Mock <IEnchiladaAdapterConfiguration>();

            adapter.Setup(x => x.AdapterName)
            .Returns(adapterName);

            var dataRepository = new EnchiladaMessageDataRepository(null, null, null);

            _factory.Setup(x => x.Create(It.IsAny <IEnchiladaFilesystemResolver>(), new Uri($"enchilada://{adapterName}")))
            .Returns(dataRepository);

            var repository = _factory.Object.Create(adapter.Object);

            Assert.That(repository, Is.SameAs(dataRepository));
        }