public void should_Create_New_No_Activation()
        {
            var device = _devices.First();

            device.Serial = "X3";

            var activation = PracticeActivation.Create(_practiceId, device, null, false);

            Assert.IsFalse(activation.IsActive());
            Console.WriteLine(activation);
        }
        public void should_Generte_IdentifierPrefix(int id, string idPrefix)
        {
            var device = _devices.First();

            device.Serial = "X3";

            var activation = PracticeActivation.Create(_practiceId, device, null, false);

            activation.Identifier = id;

            Assert.AreEqual(idPrefix, activation.IdentifierPrefix);
            Console.WriteLine($"{id} > {activation.IdentifierPrefix}");
        }
        public string EnrollDevice(DeviceInfo info)
        {
            var activation = _practiceActivationRepository.GetAll(x => x.Device.IsSameAs(info.Serial)).FirstOrDefault();

            if (null == activation)
            {
                var practiceActivation = PracticeActivation.Create(info);
                _practiceActivationRepository.Insert(practiceActivation);
                _practiceRepository.Save();
                return(practiceActivation.IdentifierPrefix);
            }

            return(activation.IdentifierPrefix);
        }