예제 #1
0
        public ApiResult <Object> Save(InputConfiguration configuration)
        {
            var cmd = new SaveInputConfiguration(storageProvider, appConfigProvider, inputConfigProvider, configuration);

            cmd.Execute();
            return(cmd.Result);
        }
 public void CreatesViewFolder()
 {
     inputConfigProviderMock.Setup(i => i.Configs).Returns(new List <InputConfiguration>());
     newConfiguration.View = "view";
     cmd = new SaveInputConfiguration(storageProvider, appConfigProvider, inputConfigProvider, newConfiguration);
     cmd.Execute();
     storageProviderMock.Verify(v => v.CreateViewFolder(It.Is <string>(s => s == newConfiguration.View)));
 }
 public void CreatesViewFolder()
 {
     inputConfigProviderMock.Setup(i => i.Configs).Returns(new List<InputConfiguration>());
     newConfiguration.View = "view";
     cmd = new SaveInputConfiguration(storageProvider, appConfigProvider, inputConfigProvider, newConfiguration);
     cmd.Execute();
     storageProviderMock.Verify(v => v.CreateViewFolder(It.Is<string>(s => s == newConfiguration.View)));
 }
        public void SavingNewConfiguration()
        {
            inputConfigProviderMock.Setup(i => i.Configs).Returns(new List <InputConfiguration>());
            cmd = new SaveInputConfiguration(storageProvider, appConfigProvider, inputConfigProvider, newConfiguration);
            cmd.Execute();
            var result = cmd.Result;

            Assert.IsTrue(result.Success);
            inputConfigProviderMock.Verify(i => i.Configs, Times.Once);
            inputConfigProviderMock.Verify(i => i.AddOrUpdate(It.IsAny <InputConfiguration>()), Times.Once);
            storageProviderMock.Verify(s => s.UpdateInputConfiguration(It.IsAny <InputConfiguration>(), It.IsAny <InputConfiguration>()), Times.Never);
            storageProviderMock.Verify(s => s.SaveInputConfiguration(It.IsAny <InputConfiguration>()), Times.Once);
        }
        public void SavingNewConfiguration()
        {
            inputConfigProviderMock.Setup(i => i.Configs).Returns(new List<InputConfiguration>());
            cmd = new SaveInputConfiguration(storageProvider, appConfigProvider, inputConfigProvider, newConfiguration);
            cmd.Execute();
            var result = cmd.Result;

            Assert.IsTrue(result.Success);
            inputConfigProviderMock.Verify(i => i.Configs, Times.Once);
            inputConfigProviderMock.Verify(i => i.AddOrUpdate(It.IsAny<InputConfiguration>()),Times.Once);
            storageProviderMock.Verify(s => s.UpdateInputConfiguration(It.IsAny<InputConfiguration>(), It.IsAny<InputConfiguration>()), Times.Never);
            storageProviderMock.Verify(s => s.SaveInputConfiguration(It.IsAny<InputConfiguration>()), Times.Once);
        }
예제 #6
0
 public ApiResult<Object> Save(InputConfiguration configuration)
 {
     var cmd = new SaveInputConfiguration(storageProvider, appConfigProvider, inputConfigProvider, configuration);
     cmd.Execute();
     return cmd.Result;
 }