コード例 #1
0
ファイル: ActionController.cs プロジェクト: eitan-j/keysndr
        public ApiResult <Object> Save(InputConfiguration configuration)
        {
            var cmd = new SaveInputConfiguration(storageProvider, appConfigProvider, inputConfigProvider, configuration);

            cmd.Execute();
            return(cmd.Result);
        }
コード例 #2
0
 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)));
 }
コード例 #3
0
 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)));
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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
ファイル: ActionController.cs プロジェクト: samiy-xx/keysndr
 public ApiResult<Object> Save(InputConfiguration configuration)
 {
     var cmd = new SaveInputConfiguration(storageProvider, appConfigProvider, inputConfigProvider, configuration);
     cmd.Execute();
     return cmd.Result;
 }