How to convert one object to onother object

Apr 19 2013 4:48 AM
HI Eveyboyd,

I have this:

2 classes:

Trial License

public partial class TrialLicense {



public partial class RealLicense {

And a testUnit:


        public void WhenTrialLicenseGoesToRealLicenseThenRealLicenseShouldBeActive()

            var target = new License(Ecospace);
            var targetTrialLicense = new TrialLicense(Ecospace);
            var targetRealLicense = new RealLicense(Ecospace);
            targetTrialLicense.StartDate = DateTime.Today.AddDays(1);
            targetTrialLicense.ExpireDate = DateTime.Today.AddDays(30);
            targetRealLicense.ExpireDate = DateTime.Today.AddDays(31);     
         Assert.IsTrue( Convert.ChangeType(System.Convert(targetTrialLicense), System.Convert(targetRealLicense)));


Now the scenario goes: after a period of time the TrialLicense goes to the RealLicense. I try to convert the object TrialLicense to the object: RealLicense.


Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (1)