find below the assingment given also find after it my answers for the assingment so far for task 1 and task 2. I would like you to complete task 3 of the assingment given the information below about my work and the assingment requirments


Assingment:
Scenario
You are contracted to develop a home appliance rental application for a local startup
company. The renting business company provides affordable rental services for people 
looking to hire home electrical appliances from small to large for a minimum period of time 
starting from ONE (1) month. Examples of types of appliances are TV, fridge, freezer, 
washing machine, dryer, dishwasher, microwave, etc.
The application should have TWO (2) types of users which are administrator and 
customer. An administrator can view, add, edit, and delete an item. A customer can create 
an account with a username and password. The usernames can only contain letters and 
numbers. The password must be of length between EIGHT (8) and SIXTEEN (16)
characters, and contain at least ONE (1) lowercase and ONE (1) uppercase letter. A 
customer can search, view, and order an item after they successfully log in the application. 
Your program should include the following requirements.
Functional Requirements:
● Customers can register.
● Customers can search appliances by type and view sorted appliances by energy 
consumption (see the table below for some common appliances, or research for 
your chosen appliances) or weekly cost. They can also add appliance items to a 
shopping cart.
● Calculation of the total price.
● Administrators can add, edit and delete appliance items.
● Log in page for customers and administrators. Appropriately handle the situation 
when a reasonable number of failed login attempts occur.
(Hutson, S. (2022). Which appliances use the most energy? Compare The 
Market. https://www.comparethemarket.com/energy/content/which-appliances-use-themost-energy/)
Appliance Power usage Typical usage Estimated annual 
running costs
LCD TV 0.21kWh per hour 6 hours a day 
(power on)
£130
Fridge Freezer (A 
spec)
408kWh per year 24 hours a day £115
Tumble Dryer 2.50kWh per cycle 148 uses a year £105
Electric hob 0.71kWh per use 424 uses a year £85
Electric oven 1.56kWh per use 135 uses per year £60
Dishwasher 1.44kWh per use (at 
65⁰C)
135 uses per year £55
Kettle 0.11kWh per use 
based on heating 1 
litre of water
1,542 uses per year £48
Non-functional Requirements:
● Set up the GUI
● Provide FIVE (5) types of appliances of your choice.
● Each type has TEN (10) appliances.
● Each appliance is rented for a monthly fee. 
● Each appliance should have an appropriate description, such as brand, model, 
dimensions, colour, energy consumption, monthly fee etc.
● All FIVE (5) types of appliances should have different minimum rental contract 
periods starting from ONE (1) month. 
● The application users are customers and administrators.
● Provide appropriate errors and help messages, and guidance for customer
Task 1 (60 Marks)
a) You need to design and implement a program (written in C#) which fulfils all the 
requirements as outlined above. 
(50 marks)
b) The quality of your program will be assessed in terms of program structure, OOP 
principles including encapsulation, algorithms using appropriate control structures
(loops and selections), and readability including appropriate comments.
(10 marks)
Task 2 (20 Marks)
You will need to develop a test plan and implement it. You should write a FIVE HUNDRED 
(500) word report about the plan, which should include the test plan, purpose of each test, 
together with test scripts*, and the testing results* with full details. 
An additional FIVE HUNDRED (500) word discussion should be included to justify how the 
data was selected and executed. 
*There is no word limit for the test scripts and testing results.
The minimum requirements for a pass mark include developing and implementing a test 
plan including test cases with some possible/invalid inputs for any TWO (2) functions 
mentioned above to ensure the functions handle the inputs as they should.
Possible exceptions should be considered and tested to make sure they are properly 
handled
Task 3 (20 Marks)
You need to: 
● Create a fully detailed class diagram, which should be accompanied by a FIVE 
HUNDRED (500) word justification of the design of your classes. Note that you are 
NOT allowed to use any tools that automatically build class diagrams.

---------------------------------------------------------------
My work:

Task1:

code:
Appliance.cs:
public class Appliance
{
    public int ID { get; set; }
    public string Type { get; set; }
    public string Brand { get; set; }
    public string Model { get; set; }
    public string Dimensions { get; set; }
    public string Color { get; set; }
    public float EnergyConsumption { get; set; }
    public decimal MonthlyFee { get; set; }
    public int MinimumRentalPeriod { get; set; }

    public Appliance() { }

    public Appliance(int id, string type, string brand, string model, string dimensions,
                     string color, float energyConsumption, decimal monthlyFee, int minimumRentalPeriod)
    {
        ID = id;
        Type = type;
        Brand = brand;
        Model = model;
        Dimensions = dimensions;
        Color = color;
        EnergyConsumption = energyConsumption;
        MonthlyFee = monthlyFee;
        MinimumRentalPeriod = minimumRentalPeriod;
    }

    public static List<Appliance> LoadAppliancesFromDatabase(string connectionString)
    {
        // A list of loaded appliances is created to store the data retrieved from the database.
        List<Appliance> loadedAppliances = new List<Appliance>();

        using (OleDbConnection connection = new OleDbConnection(connectionString))
        {
            // The connection to the database is opened.
            connection.Open();
            using (OleDbCommand cmd = new OleDbCommand(“SELECT * FROM appliance_list”, connection))
            using (OleDbDataReader reader = cmd.ExecuteReader())
            {
                // The data is retrieved from the database and read.
                while (reader.Read())
                {
                    Appliance appliance = new Appliance(
                        (int)reader[“ID”],        // The appliance's ID is retrieved from the database and converted to an int.
                        reader[“Type”].ToString(), // The appliance's type is retrieved from the database and converted to a string.
                        reader[“Brand”].ToString(), // The appliance's brand is retrieved from the database and converted to a string.
                        reader[“Model”].ToString(), // The appliance's model is retrieved from the database and converted to a string.
                        reader[“Dimensions”].ToString(), // The appliance's dimensions are retrieved from the database and converted to a string.
                        reader[“Color”].ToString(), // The appliance's color is retrieved from the database and converted to a string.
                        (float)reader[“EnergyConsumption”], // The appliance's energy consumption is retrieved from the database and converted to a float.
                        (decimal)reader[“MonthlyFee”], // The appliance's monthly fee is retrieved from the database and converted to a decimal.
                        (int)reader[“MinimumRentalPeriod”]); // The appliance's minimum rental period is retrieved from the database and converted to an int.

                    loadedAppliances.Add(appliance); // The new appliance object is added to the list of loaded appliances.
                }
            }
            // The connection to the database is closed.
            connection.Close();
        }

        return loadedAppliances; // The list of loaded appliances is returned.
    }
}
Customer.cs:
public class Customer
{
    public string Username { get; set; } // properties for customer details
    public string Password { get; set; }
    public string FullName { get; set; }
    public string Email { get; set; }
    public string Address { get; set; }

    public Customer() { } // default constructor

    public Customer(string username, string password, string fullName, string email, string address) // constructor to set customer details
    {
        Username = username;
        Password = password;
        FullName = fullName;
        Email = email;
        Address = address;
    }

    public bool IsValid() // method to validate customer details
    {
        if (string.IsNullOrEmpty(Username) || string.IsNullOrEmpty(Password) || // check for empty fields
            string.IsNullOrEmpty(FullName) || string.IsNullOrEmpty(Email) || string.IsNullOrEmpty(Address))
        {
            return false;
        }

        if (Password.Length < 8 || Password.Length > 16) // check for password length
        {
            return false;
        }

        if (!Password.Any(char.IsLower) || !Password.Any(char.IsUpper)) // check for password complexity
        {
            return false;
        }

        return true;
    }

    public static List<Customer> LoadCustomersFromDatabase(string connectionString) // method to load customers from database
    {
        List<Customer> loadedCustomers = new List<Customer>(); // list to hold loaded customers

        using (OleDbConnection connection = new OleDbConnection(connectionString)) // create connection to database
        {
            connection.Open(); // open the connection

            using (OleDbCommand cmd = new OleDbCommand(“SELECT * FROM tbl_users WHERE[User Type] =‘Customer’”, connection)) // create command to retrieve customer data
            using (OleDbDataReader reader = cmd.ExecuteReader()) // execute command and create data reader
            {
                while (reader.Read()) // loop through each row in the data reader
                {
                    Customer customer = new Customer( // create new customer object
                        reader[“username”].ToString(),
                        reader[“password”].ToString(),
                        reader[“fullname”].ToString(),
                        reader[“email”].ToString(),
                        reader[“address”].ToString());

                    loadedCustomers.Add(customer); // add customer to list
                }
            }

            connection.Close(); // close the connection
        }

        return loadedCustomers; // return list of loaded customers
    }
}
Form1.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.Remoting.Lifetime;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;

namespace ApplianceRental
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_users.mdb");
            OleDbCommand cmd = new OleDbCommand();
            OleDbDataAdapter da = new OleDbDataAdapter();
        }
        // Connects to database
        OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_users.mdb");
        OleDbCommand cmd = new OleDbCommand();
        OleDbDataAdapter da = new OleDbDataAdapter();
        private void Form1_Load(object sender, EventArgs e)
        {
        }
        // Add a counter variable or class level property
        private int failedAttempts = 0;
        private void button1_Click(object sender, EventArgs e)
        {
            string username = textBox1.Text;
            string password = textBox2.Text;
            // Max login attempts
            if (failedAttempts >= 3)
            {
                MessageBox.Show("Maximum login attempts reached. Contact the admin");
                this.Close();
            }

            con.Open();
            string login = "SELECT * FROM tbl_users WHERE username = '" + textBox1.Text + "' and password= '" + textBox2.Text + "'";
            cmd = new OleDbCommand(login, con);
            OleDbDataReader dr = cmd.ExecuteReader();
            if (dr.Read() == true)
            {
                string userType = dr["User Type"].ToString();
                con.Close();

                if (userType == "Admin")
                {
                    // Open the Admin Dashboard form
                    AdminDashboardForm adminDashboardForm = new AdminDashboardForm();
                    adminDashboardForm.Show();
                    this.Hide();
                }
                else
                {
                    new CustomerDashboardForm().Show();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Invalid username or password! Please try again.");
                failedAttempts++;
            }
            con.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            new RegistrationForm().Show();
            this.Hide();
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            //snippet to unhide password if ticked
            if (checkBox1.Checked)
            {
                textBox2.PasswordChar = '\0';
            }
            else
            {
                textBox2.PasswordChar = '*';
            }
        }

        private void Form1_Load_1(object sender, EventArgs e)
        {

        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }
        private void pictureBox1_Enter(object sender, EventArgs e)
        {
            pictureBox1.TabStop = false;
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
RegistrationForm.cs:
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ListView;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
using System.Collections.Generic;
using System.Data.OleDb;
using System.Net;
using System.Windows.Forms;
using System;
using System.Linq;

namespace ApplianceRental
{
    public partial class RegistrationForm : Form
    {
        private readonly OleDbConnection connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db_users.mdb");

        public RegistrationForm()
        {
            InitializeComponent();
        }

        private void Register_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("Please enter a username.");
                return;
            }

            if (string.IsNullOrEmpty(textBox2.Text))
            {
                MessageBox.Show("Please enter a password.");
                return;
            }

            if (textBox2.Text != textBox3.Text)
            {
                MessageBox.Show("Passwords do not match.");
                return;
            }

            if (string.IsNullOrEmpty(textBox4.Text))
            {
                MessageBox.Show("Please enter your full name.");
                return;
            }

            if (string.IsNullOrEmpty(textBox5.Text))
            {
                MessageBox.Show("Please enter your email address.");
                return;
            }

            if (string.IsNullOrEmpty(textBox6.Text))
            {
                MessageBox.Show("Please enter your address.");
                return;
            }

            if (textBox2.Text.Length < 8 || textBox2.Text.Length > 16)
            {
                MessageBox.Show("Password must be between 8 and 16 characters.");
                return;
            }

            if (!textBox2.Text.Any(char.IsLower) || !textBox2.Text.Any(char.IsUpper))
            {
                MessageBox.Show("Password must contain at least one lowercase and one uppercase letter.");
                return;
            }

            connection.Open();

            using (var cmd = new OleDbCommand())
            {
                cmd.Connection = connection;
                cmd.CommandText = "INSERT INTO tbl_users(username, [password], fullname, email, address, [User Type]) " +
                    "VALUES(@username, @password, @fullname, @email, @address, 'Customer')";

                cmd.Parameters.AddWithValue("@username", textBox1.Text);
                cmd.Parameters.AddWithValue("@password", textBox2.Text);
                cmd.Parameters.AddWithValue("@fullname", textBox4.Text);
                cmd.Parameters.AddWithValue("@email", textBox5.Text);
                cmd.Parameters.AddWithValue("@address", textBox6.Text);

                cmd.ExecuteNonQuery();
            }

            MessageBox.Show("Registration successful!");
            ClearFields();
            this.Hide();
            new Form1().Show();

            connection.Close();
        }

        private void ClearFields()
        {
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";
            textBox4.Text = "";
            textBox5.Text = "";
            textBox6.Text = "";
        }
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
        }

        private void textBox4_TextChanged(object sender, EventArgs e)
        {
        }

        private void textBox5_TextChanged(object sender, EventArgs e)
        {
        }

        private void textBox6_TextChanged(object sender, EventArgs e)
        {
        }
    }
}
CustomerDashboard.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.Remoting.Lifetime;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using System.Text.RegularExpressions;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;

namespace ApplianceRental
{
    public partial class CustomerDashboardForm : Form
    {
        private DataTable cartItems = new DataTable();
        public CustomerDashboardForm()
        {
            InitializeComponent();
            cartItems.Columns.Add("Appliance");
            cartItems.Columns.Add("PowerUsage");
            cartItems.Columns.Add("TypicalUsage");
            cartItems.Columns.Add("AnnualCost");
            // Set dataGridViewCart DataSource
            dataGridViewCart.DataSource = cartItems;
        }

        private void CustomerDashboardForm_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'db_usersDataSet.ApplianceDBLIST' table. You can move, or remove it, as needed.
            this.applianceDBLISTTableAdapter.Fill(this.db_usersDataSet.ApplianceDBLIST);
            BindingSource bindingSource = new BindingSource();
            bindingSource.DataSource = this.db_usersDataSet.ApplianceDBLIST;
            comboBox1.DataSource = bindingSource;
            comboBox1.DisplayMember = "Appliance";  // replace “Appliance” with your actual appliance column name
            dataGridView1.DataSource = bindingSource;
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {
                if (dataGridView1.Rows[i].Cells[0].Value != null)  // Add this line to check for null values
                {
                    string applianceInGrid = dataGridView1.Rows[i].Cells[0].Value.ToString(); // Assuming Appliance is the first column
                    string applianceInComboBox = comboBox1.SelectedItem.ToString();

                    if (applianceInGrid == applianceInComboBox)
                    {
                        dataGridView1.ClearSelection();
                        dataGridView1.Rows[i].Selected = true;
                        dataGridView1.CurrentCell = dataGridView1.Rows[i].Cells[0];
                        break;
                    }
                }
                }
            }
        private void CalculateTotal()
        {
            decimal totalAmount = 0;

            foreach (DataRow row in cartItems.Rows)
            {
                totalAmount += Convert.ToDecimal(row["AnnualCost"]);
            }

            labelTotalAmount.Text = totalAmount.ToString("C", new System.Globalization.CultureInfo("en-GB"));
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex < 0)
            {
                MessageBox.Show("Please select an appliance to add to the cart.");
            }
            else
            {
                // Get the selected row in dataGridView1
                DataGridViewRow selectedRow = dataGridView1.Rows[comboBox1.SelectedIndex];

                // Create a new row for cartItems
                DataRow newRow = cartItems.NewRow();

                newRow["Appliance"] = selectedRow.Cells[0].Value; // Use the column index instead of name
                newRow["PowerUsage"] = selectedRow.Cells[1].Value; // Assuming Power Usage is the second column
                newRow["TypicalUsage"] = selectedRow.Cells[2].Value; // Assuming Typical Usage is the third column
                newRow["AnnualCost"] = selectedRow.Cells[3].Value; // Assuming Estimated Annual Costs is the fourth column

                // Add newRow to the cartItems
                cartItems.Rows.Add(newRow);

                // Calculate and display the total amount
                CalculateTotal();
            }
        }

        private void searchBox_TextChanged(object sender, EventArgs e)
        {
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(searchBox.Text))
            {
                MessageBox.Show("Please enter something to search");
            }
            else
            {
                DataView dataView = db_usersDataSet.ApplianceDBLIST.DefaultView;
                string searchExpression = Regex.Escape(searchBox.Text.Trim()).Replace("'", "''");
                dataView.RowFilter = string.Format("Appliance LIKE '%{0}%'", searchExpression);
                dataGridView1.DataSource = dataView;
            }
        }

        private void flowLayoutPanel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void labelTotalAmount_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
Admindashboard.cs:
// This is a C# code for a Windows Form Application.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace ApplianceRental
{
    public partial class AdminDashboardForm : Form
    {
        // Declare class-level variables
        OleDbDataAdapter sda;
        OleDbCommandBuilder scb;
        DataTable dt;
        OleDbConnection con;
        string connectionString = $@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source = {Path.Combine(Application.StartupPath, "db_users.mdb")}";
        // Constructor method
        public AdminDashboardForm()
        {
            InitializeComponent();
            // Initialize OleDbConnection object
            con = new OleDbConnection(connectionString);
        }

        // Event handler for the form's loading event
        private void AdminDashboardForm_Load(object sender, EventArgs e)
        {
            // No implementation
        }

        // Event handler for DataGridView's cell content click 
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            // Code logic for the event handler
            // Not implemented in this case
        }

        // Event handler for Save button click event
        private void button1_Click(object sender, EventArgs e)
        {
            string query = "SELECT * FROM ApplianceDBLIST";
            sda = new OleDbDataAdapter(query, con);
            OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(sda);

            dt = new DataTable();
            sda.Fill(dt);
            dataGridView1.DataSource = dt;
        }
        private void saveButton_Click(object sender, EventArgs e)
        {
            // Using block for insert, update and delete commands
            using (OleDbCommand insertCommand = new OleDbCommand("INSERT INTO ApplianceDBLIST ([Appliance], [Power Usage], [Typical Usage], [Estimated Annual Costs]) VALUES (?, ?, ?, ?)", con),
                              updateCommand = new OleDbCommand("UPDATE ApplianceDBLIST SET [Appliance]=?, [Power Usage]=?, [Typical Usage]=?, [Estimated Annual Costs]=? WHERE ID=?", con),
                              deleteCommand = new OleDbCommand("DELETE FROM ApplianceDBLIST WHERE ID=?", con))
            {
                // insert command
                sda.InsertCommand = insertCommand;
                insertCommand.Parameters.Add("@Appliance", OleDbType.VarWChar, 0, "Appliance");
                insertCommand.Parameters.Add("@Power_Usage", OleDbType.VarWChar, 0, "Power Usage");
                insertCommand.Parameters.Add("@Typical_Usage", OleDbType.VarWChar, 0, "Typical Usage");
                insertCommand.Parameters.Add("@Estimated_annual_costs", OleDbType.VarWChar, 0, "Estimated Annual Costs");

                // update command
                sda.UpdateCommand = updateCommand;
                updateCommand.Parameters.Add("@Appliance", OleDbType.VarWChar, 0, "Appliance");
                updateCommand.Parameters.Add("@Power_Usage", OleDbType.VarWChar, 0, "Power Usage");
                updateCommand.Parameters.Add("@Typical_Usage", OleDbType.VarWChar, 0, "Typical Usage");
                updateCommand.Parameters.Add("@Estimated_annual_costs", OleDbType.VarWChar, 0, "Estimated Annual Costs");
                updateCommand.Parameters.Add("@ID", OleDbType.Integer, 0, "ID");
                updateCommand.UpdatedRowSource = UpdateRowSource.None;
                // NOTE: in order to edit you have to manually click on the row enter appropriate data and click on save.

                // delete command
                sda.DeleteCommand = deleteCommand;
                deleteCommand.Parameters.Add("@ID", OleDbType.Integer, 0, "ID");
                deleteCommand.UpdatedRowSource = UpdateRowSource.None;

                // Open the database connection
                con.Open();
                // Update the DataTable with changes made
                sda.Update(dt);
                // Close the database connection
                con.Close();

                // Refresh the data after updating, to display updated data in DataGridView
                dt.Clear();
                sda.Fill(dt);
            }


        }
       
    }
}

Task 2:

Testing Reports

1. Objective: Validate the user registration with valid input data and verify successful registration
Test Steps:
- Open the registration form.
- Enter a valid username, password with appropriate lowercase and uppercase, full name, email address, and address.
- Click the “Register” button.
Expected Result: User should be registered successfully and a “Registration successful!” mes-sage should be displayed.

2. Objective: Validate the user registration with a mismatched password and verify the error message
Test Steps:
- Open the registration form.
- Enter a valid username, different password, and confirm password, full name, email address, and address.
- Click the “Register” button.
Expected Result: User should not be registered, and the error message “Passwords do not match.” should be displayed.

3. Objective: Validate the user registration with a password shorter than 8 characters
Test Steps:
- Open the registration form.
- Enter a valid username, a password shorter than 8 characters, and a matching confirm pass-word, full name, email address, and address.
- Click the “Register” button.
Expected Result: User should not be registered, and the error message “Password must be be-tween 8 and 16 characters.” should be displayed.

4. Objective: Validate the user registration with a password without lowercase or uppercase characters
Test Steps:
- Open the registration form.
- Enter a valid username, a password with no uppercase or lowercase characters, and a match-ing confirm password, full name, email address, and address.
- Click the “Register” button.
Expected Result: User should not be registered, and the error message “Password must contain at least one lowercase and one uppercase letter.” should be displayed.

5. Objective: Verify the appliance search functionality with a valid input
Test Steps:
- Log in to the application with a valid customer account.
- Enter a valid appliance name in the search box.
- Click the search button.
Expected Result: The searched appliance should be displayed in the list.


Testing Scripts

Test Data: { “username”: “kristina92”, “password”: “GhajnTuffieha456”, “confirm password”: “GhajnTuffieha456”, “fullname”: “Kristina Farrugia”, “email”: “<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>”, “ad-dress”: “Triq l-Għajn, Il-Mosta” }
Expected Result: Registration successful!
Test Data: { “username”: “Anton21”, “password”: “PawluL-Iskandar321”, “confirm password”: “PawluL-Iskandar1234”, “fullname”: “Anton Attard”, “email”: “<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>”, “ad-dress”: “Triq San Pawl, Tas-Sliema” }
Expected Result: Passwords do not match.
Test Data: { “username”: “CarmelP”, “password”: “Karmenu”, “confirm password”: “Karmenu”, “fullname”: “Carmel Pace”, “email”: “carmel.pace@example.com”, “address”: “25, Triq il-Kappillan, Ħal Tarxien” }
Expected Result: Password must be between 8 and 16 characters.
Test Data: { “username”: “GabriellaBorg”, “password”: “TestPass123”, “confirm password”: “TestPass123”, “fullname”: “Gabriella Borg”, “email”: “gabriella.borg@example.com”, “address”: “17, Triq L-Imdina, L-Isla” }
Expected Result: Password must contain at least one lowercase and one uppercase letter.

Testing Results

Test 1:
- Executed the test script with given test data.
- Registration successful message was displayed.
- The user account was created successfully in the database.












Test 2:
- Executed the test script with given test data.
- Passwords do not match an error message was displayed.
- The account was not created in the database.
 
Test 3:
- Executed the test script with given test data.
- The password must be between 8- and 16-characters error message was displayed.
- The account was not created in the database.
 

Test 4:
- Executed the test script with given test data.
- Password must contain at least one lowercase and one uppercase letter error message was displayed.
- The account was not created in the database.
 


Test 5:
- Executed the test script with given test data.
- Tumble Dryer displayed in the list.
 
Data Selection and Execution Justification
For the test cases, we used different sets of test data that cover various scenarios and ensure that the application handles the inputs as expected. The test data was selected based on the application’s requirements and possible user inputs, ranging from valid to invalid entries.
For user registration, we selected valid input data to verify successful registration, ensuring that the system correctly processes the data and registers a new user. This data set helps us validate that the registration functionality works as intended. Additionally, we tested registration with passwords that are too short, too long, or without the required combination of characters to validate the application’s error handling capabilities.
To verify the appliance search functionality, we selected a valid search term (“Tumble Dryer”) that we expected to match an appliance in the database. This test checks if the application can search and display records based on user input, ensuring that the search functionality works as expected.
To execute the test plan, we followed the steps outlined in each test case using the selected test data. We documented the results based on the system’s response to the inputs and actions, confirming that the application behaves as expected under various conditions.
The methods selected above fall under the broad term “Black Box Testing” where we only pay attention to the inputs and expectations of outputs in the desired program. In this specific c# program we have used Unit Testing as part of “White Box Testing” where a class, method or statement is isolated and tested alone to analyze its output.
The home appliance rental application has been thoroughly tested using the test cases provided, ensuring that it meets both functional and non-functional requirements. The test results show that the application effectively manages user registration, allows customers to search for and rent appliances, while also enabling administrators to manage appliance records.
The selected test data covers a wide range of input scenarios and user behaviors, validating the application’s ability to handle both expected and unexpected situations. While the testing performed provides a high degree of confidence in the application’s quality, it is essential to continue refining and expanding the test cases to keep up with ongoing development and feature enhancement. With a robust test plan in place, the application can continue to evolve and meet user needs in the home appliance rental space

Task 3: (you complete it)