public void DeleteCurrent_NoDataInProjectAndAllowedToDelete_WritingSystemIsDeleted()
 {
     using (var e = new DeleteCurrentTestEnvironment())
     {
         _model.AskIfOkToDeleteWritingSystems += e.OnAskIfOkToDeleteWritingSystem_Yes;
         _model.AddPredefinedDefinition(new WritingSystemDefinition("pt"));
         _model.Save();
         Assert.That(_model.WritingSystemDefinitions.Any(ws => ws.LanguageTag == "pt"), Is.True);
         _model.DeleteCurrent();
         Assert.That(_model.WritingSystemDefinitions.Any(ws => ws.LanguageTag == "pt"), Is.False);
     }
 }
        public void SingleWSMode_Save_Throws()
        {
            _model = new WritingSystemSetupModel(new WritingSystemDefinition());

            Assert.Throws <InvalidOperationException>(
                () => _model.Save()
                );
        }
 private void _closeButton_Click(object sender, EventArgs e)
 {
     try
     {
         _model.Save();
         Close();
     }
     catch (ArgumentException exception)
     {
         MessageBox.Show(
             this, exception.Message, "Input Systems Error",
             MessageBoxButtons.OK, MessageBoxIcon.Exclamation
             );
     }
 }
Пример #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     _wsModel.Save();
 }
		public void SingleWSMode_Save_Throws()
		{
			_model = new WritingSystemSetupModel(new WritingSystemDefinition());

			Assert.Throws<InvalidOperationException>(
				() => _model.Save()
			);
		}