<commit_before>﻿using System;
using NUnit.Framework;

namespace UnitTestsLibrary
{
    /// <summary>
    /// The demo application for Unit Tests
    /// </summary>
    public class BankAccount
    {
        public int Balance { get; private set; }
        public BankAccount(int startingBalance)
        {
            Balance = startingBalance;
        }

        public void Deposit(int amount)
        {
            this.Balance += amount;
        }

        public void Withdraw(int amount)
        {
            this.Balance -= amount;
        }
    }
    [TestFixture]
    public class AccountTests
    {
        [Test]
        public void BankAccountShouldIncreaseOnPositiveDeposit() 
        {
            // pattern:
            // aaa - arrange, act, asset

            //step one, arrage -  "arrange with a starting balance of 100"
            var bankAccount = new BankAccount(100);
            //act - "act on the bank account by depositing 100" 
            bankAccount.Deposit(100);
            // assert - "assert the new balance is equal to 200"
            Assert.That(bankAccount, Is.EqualTo(200));

        }
    }
}
<commit_msg>added assert.multiple example, added setup example<commit_after>﻿using System;
using NUnit.Framework;

namespace UnitTestsLibrary
{
    /// <summary>
    /// The demo application for Unit Tests
    /// </summary>
    public class BankAccount
    {
        public int Balance { get; private set; }
        public BankAccount(int startingBalance)
        {
            Balance = startingBalance;
        }

        public void Deposit(int amount)
        {
            this.Balance += amount;
        }

        public void Withdraw(int amount)
        {
            this.Balance -= amount;
        }
    }
    [TestFixture]
    [SetUpFixture]
    public class AccountTests
    {
        public BankAccount Account { get; set; }
        [SetUp]
        public void SetUp()
        {
            //step one, arrage -  "arrange with a starting balance of 100"
            Account = new BankAccount(100);
        }


        [TearDown]
        public void TearDown()
        {
            Account = null;
        }
        [Test]
        public void BankAccountShouldIncreaseOnPositiveDeposit() 
        {
            // pattern:
            // aaa - arrange, act, asset
            //act - "act on the bank account by depositing 100" 
            Account.Deposit(100);
            // assert - "assert the new balance is equal to 200"
            Assert.That(Account.Balance, Is.EqualTo(200));
        }

        [Test]
        public void LessThanOne()
        {
            Account.Withdraw(100);
            Assert.Multiple(() =>
            {
                Assert.That(Account.Balance, Is.EqualTo(0));
                Assert.That(Account.Balance, Is.LessThan(1));
            });
        }
    }
}

{'fraction_non_alphanumeric': 0.09237794169301018, 'fraction_numerical': 0.014401123990165085, 'mean_word_length': 1.5070422535211268, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5828017', 'n_tokens_mistral': 796, 'n_tokens_neox': 750, 'n_words': 206}