コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }