public void When_OwnerHasNotUsedDeviceForCertainPeriodOfTime_then_CantPurchaseDevice()
        {
            DeviceOwner     deviceOwner     = DeviceOwner.WithoutPurchasedHistory(Guid.NewGuid(), _usedDevices);
            PurchasedDevice purchasedDevice = _samePurchasedDeviceAsTheUsedOne;

            deviceOwner.Purchase(purchasedDevice, 1000);

            Assert.That(deviceOwner.DidPurchase(purchasedDevice), Is.False);
        }
        public void When_OwnerPurchaseCurrentlyUsedDevice_then_PurchaseItOut()
        {
            DeviceOwner     deviceOwner     = DeviceOwner.WithoutPurchasedHistory(Guid.NewGuid(), _usedDevices);
            PurchasedDevice purchasedDevice = _samePurchasedDeviceAsTheUsedOne;

            deviceOwner.Purchase(purchasedDevice, 0);

            Assert.That(deviceOwner.DidPurchase(purchasedDevice), Is.True);
        }
        public void When_OwnerHasNotCurrentlyUsedDevice_then_CantPurchaseDevice()
        {
            DeviceOwner     deviceOwner     = DeviceOwner.WithoutPurchasedHistory(Guid.NewGuid(), new List <UsedDevice>());
            PurchasedDevice purchasedDevice = _samePurchasedDeviceAsTheUsedOne;

            deviceOwner.Purchase(purchasedDevice, 0);

            Assert.That(deviceOwner.DidPurchase(purchasedDevice), Is.False);
        }
        public void SetUp()
        {
            var guid = Guid.NewGuid();

            _anyUsedDevice = UsedDevice.UsedSince(guid, new DateTime(2018, 1, 1));
            _samePurchasedDeviceAsTheUsedOne = new PurchasedDevice(guid);
            _usedDevices = new List <UsedDevice> {
                _anyUsedDevice
            };
            _purchasedDevices = new List <PurchasedDevice> {
                _samePurchasedDeviceAsTheUsedOne
            };
        }