Exemple #1
0
        private string SaveActivation()
        {
            ActivationParams p = new ActivationParams();

            p.LicenseID      = license.ID;
            p.GeneratedBy    = license.GeneratedBy;
            p.ExpirationDate = dtExpirationDate.Value;
            p.ExpirationWarningsBeginDate = licenseFeatures.ExpirationWarningStartDate;
            p.ExtendedExpirationDate      = dtExtendedExpirationDate.Value;
            p.ActivationCode = lblActivationCode.Text;
            p.CPUID          = txtCPUID.Text;
            p.Enabled        = chkIsEnabled.Checked;
            p.GeneratedTime  = DateTime.Now;
            p.IsActivated    = false;

            if (p.CPUID != string.Empty && p.ActivationCode != string.Empty)
            {
                p.IsActivated = true;
            }

            if (this.activation != null)
            {
                p.ID = this.activation.ID;
                return(licenseService.SaveActivation(p));
            }
            else
            {
                return(licenseService.AddActivation(p));
            }
        }
        public void Test_Setting_TypeName_Stores_Correct_Type(string storedType, Type expected)
        {
            var p = new ActivationParams();

            p.SetPropertyValue("TypeName", storedType);
            p.Type.ShouldBeEquivalentTo(expected);
        }
        public void Test_TypeName_Stores_The_Name_Of_The_Stored_Type(Type type, string expected)
        {
            var p = new ActivationParams()
            {
                Type = type
            };

            p.GetPropertyValue("TypeName").Should().Be(expected);
        }
Exemple #4
0
 public string SaveActivation(ActivationParams p)
 {
     try
     {
         return(ActivationService.SaveActivation(p).ToString());
     }
     catch (Exception ex)
     {
         return(string.Format("Error: {0}{1}{2}", ex.Message, Environment.NewLine, ex.InnerException.ToString()));
     }
 }
Exemple #5
0
 public string AddActivation(ActivationParams p)
 {
     try
     {
         return(ActivationService.CreateActivation(p).ToString());
     }
     catch (Exception ex)
     {
         return(string.Format("Error: {0}", ex.Message));
     }
 }
Exemple #6
0
 private static object[] ShowViewModelAction(ActivationParams first, ActivationParams second, bool areEqual) =>
 new object[]
 {
     new ShowViewModelAction()
     {
         ActivationParams = first
     },
     new ShowViewModelAction()
     {
         ActivationParams = second
     },
     areEqual
 };
        public void Test_ActivationParams_Are_Equal_When_Their_Types_Are_Equal(Type first, Type second, bool areEqual)
        {
            var f = new ActivationParams()
            {
                Type = first
            };
            var s = new ActivationParams()
            {
                Type = second
            };

            if (areEqual)
            {
                f.Should().Be(s);
                s.Should().Be(f);
            }
            else
            {
                f.Should().NotBe(s);
                s.Should().NotBe(f);
            }
        }
        public void Test_ActivationParams_Are_Equal_When_Their_Parameters_Are_Equal(object first, object second,
                                                                                    bool areEqual)
        {
            var f = new ActivationParams()
            {
                Params = first
            };
            var s = new ActivationParams()
            {
                Params = second
            };

            if (areEqual)
            {
                f.Should().Be(s);
                s.Should().Be(f);
            }
            else
            {
                f.Should().NotBe(s);
                s.Should().NotBe(f);
            }
        }