Exemple #1
0
        public void ConfigHelpter_Instance()
        {
            var fileMock   = new Mock <IFileHelper>();
            var stringJson = ConfigHelpterMock.get_Json_ConfigHelpter_Load();

            fileMock.Setup(m => m.Reader(It.IsAny <string>())).Returns(stringJson);

            var config = new LMDataBaseInitialConfig.ConsoleApp.Config.ConfigHelpter(fileMock.Object);

            Assert.NotNull(config);
            Assert.NotNull(config.GetTables());
        }
Exemple #2
0
        public void ConfigHelpter_Load()
        {
            var fileHelper = new Mock <IFileHelper>();

            fileHelper.Setup(m => m.Reader(It.IsAny <string>())).Returns(ConfigHelpterMock.get_Json_ConfigHelpter_Load());
            fileHelper.Setup(m => m.Exists(It.IsAny <string>())).Returns(true);

            var config = new LMDataBaseInitialConfig.ConsoleApp.Config.ConfigHelpter(fileHelper.Object);

            config.Save();

            fileHelper.Verify(c => c.Save(It.IsAny <string>(), It.Is <string>(i => Helper.CompareOnlyCaracterString(ConfigHelpterMock.get_Json_ConfigHelpter_Load(), (i)))), Times.Once(), "Json was not saved as should");
        }