コード例 #1
0
        public void RemoveFromCurrencyTest()
        {
            _currencies.Set(_gold, 10f);

            var result = _currencies.Remove(_gold, 1f);

            Assert.IsNull(result.error);
            Assert.IsTrue(result.result);
            Assert.AreEqual(9f, _currencies.GetAmount(_gold));
        }
コード例 #2
0
        public void Removing_Null_Throws_ArgumentNullException()
        {
            var sut = new CurrencyCollection
            {
                EUR
            };
            Action action = () => sut.Remove(null);

            action.Should().Throw <ArgumentNullException>();
        }
コード例 #3
0
        public void Removing_A_Currency_Does_Not_Depend_On_Pointer_Reference()
        {
            var sut = new CurrencyCollection
            {
                new Currency("AED")
            };

            sut.Remove(new Currency("AED"));

            sut.Count.Should().Be(0);
        }
コード例 #4
0
        public void Removing_A_Currency_That_Was_Not_Registered_Does_Not_Do_Anything()
        {
            var sut = new CurrencyCollection
            {
                EUR
            };

            sut.Remove(new Currency("AED"));

            sut.Count.Should().Be(1);
        }
コード例 #5
0
        private void RemoveCurrencyFromCollection()
        {
            CurrencyCollection.Remove(SelectedCurrencyItem);
            _MyMainWindow.SelectFirstItem();                       /// Selects first item after removing
            _CurrencyDeleteView.Close();
            _jsonDataService.SaveCurrencyData(CurrencyCollection); /// Saves currency data to the hard drive

            if (CurrencyCollection.Count == 0)
            {
                IsRemoveBtnEnabled = false;
            }
        }
コード例 #6
0
        public void Remove_Currency_From_List()
        {
            var sut = new CurrencyCollection
            {
                EUR
            };

            sut.Count.Should().Be(1);

            sut.Remove(EUR);

            sut.Count.Should().Be(0);
        }