public void LoadFromFile_Test_ThrowsException()
        {
            // arrange
            var txtFileLoadSave = new TxtFileLoadSave();

            // act
            var result = txtFileLoadSave.LoadFromFile("fileName");
        }
        public void LoadFromFile_Test_ReturnsCountIs0()
        {
            // arrange
            var txtFileLoadSave = new TxtFileLoadSave();

            Isolate.WhenCalled(() => File.Exists(null)).WillReturn(true);
            var stringList = new string[] {};

            Isolate.WhenCalled(() => File.ReadAllLines(null)).WillReturn(stringList);

            // act
            var result = txtFileLoadSave.LoadFromFile("fileName");

            // assert
            Assert.AreEqual(0, result.Count);
        }
        public void LoadExpenseItems_Test_ReturnsFalse()
        {
            // arrange
            var expenseViewer            = new ExpenseViewer();
            var propertyChangedWasRaised = false;

            expenseViewer.PropertyChanged += (a, b) => propertyChangedWasRaised = true;
            var expenseData = new ExpenseData();
            var propertyChangedWasRaised1 = false;

            expenseData.PropertyChanged += (a, b) => propertyChangedWasRaised1 = true;
            var items = expenseData.Items;

            expenseData.Items          = items;
            expenseViewer.ExpenseTable = expenseData;
            var propertyChangedWasRaised2 = false;

            expenseViewer.PropertyChanged += (a, b) => propertyChangedWasRaised2 = true;
            var propertyChangedWasRaised3 = false;

            expenseViewer.PropertyChanged += (a, b) => propertyChangedWasRaised3 = true;
            var fileLoader = new TxtFileLoadSave();

            Isolate.WhenCalled(() => File.Exists(null)).WillReturn(true);
            var expenseItem     = new ExpenseItem();
            var expenseItemList = new List <ExpenseItem> {
                expenseItem
            };

            Isolate.WhenCalled(() => fileLoader.LoadFromFile(null)).WillReturn(expenseItemList);

            // act
            var result = expenseViewer.LoadExpenseItems(fileLoader, "Unable to load any data");

            // assert
            Assert.AreEqual(false, result);
        }