public void OnOkButtonClicked()
 {
     if (_view.MaterialType == MaterialType.BaseMaterial)
     {
         if (!string.IsNullOrEmpty(_view.NormName.Trim()))
         {
             var normToSave = new BaseNorm() { Name = _view.NormName };
             _dataConnector.SaveBaseNorm(normToSave);
             _view.CloseDialog();
         }
     }
     else
     {
         if (!string.IsNullOrEmpty(_view.NormName.Trim()))
         {
             var normToSave = new AdditiveNorm() { Name = _view.NormName };
             _dataConnector.SaveAdditiveNorm(normToSave);
             _view.CloseDialog();
         }
     }
 }
        public void ShouldNotChangeMaterialGUIDWhenDeserializingMaterial()
        {
            //given
            BaseMaterial material1 = _dataCreator.GetSampleMaterial();
            Debug.WriteLine("Guid1:   " + material1.GuidNumber);

            BaseNorm norm = new BaseNorm();
            norm.Name = "allahuakbar";
            norm.Materials.Add(material1);

            //when
            _repo.SerializeBaseNorm(norm);
            BaseNorm newNorm = _repo.DeserializeBaseNorm("allahuakbar");
            Debug.WriteLine("Guid2:   " + newNorm.Materials[0].GuidNumber);

            string guid1 = material1.GuidNumber.ToString();
            string guid2 = norm.Materials[0].GuidNumber.ToString();

            //then
            Assert.AreEqual(guid1, guid2);
        }
 public void SaveBaseNorm(BaseNorm norm)
 {
     _normRepo.SerializeBaseNorm(norm);
 }