Ejemplo n.º 1
0
        public void LoadResources_LoadResourceCatalog_Success()
        {
            //------------------Arrange---------------
            const string resourceDirectory = "Resources - ServerTests";

            var mockWriter                 = new Mock <IWriter>();
            var mockDirectory              = new Mock <IDirectory>();
            var mockResourceCatalog        = new Mock <IResourceCatalog>();
            var mockResourceCatalogFactory = new Mock <IResourceCatalogFactory>();

            mockResourceCatalogFactory.Setup(o => o.New()).Returns(mockResourceCatalog.Object);
            mockResourceCatalog.Setup(o => o.CleanUpOldVersionControlStructure()).Verifiable();

            mockWriter.Setup(o => o.WriteLine("done.")).Verifiable();
            //------------------Act-------------------
            var loadResources = new LoadResources(resourceDirectory, mockWriter.Object, mockDirectory.Object, mockResourceCatalogFactory.Object);

            loadResources.LoadResourceCatalog();
            //------------------Assert----------------
            mockWriter.Verify();
        }