Backend Setup

Setup of Backend Endpoint Framework

  1. Clone a separate Database for regression Testing in SMSS

  2. Create a custom seeder task for generation of Testing Data which will be inserted in Database

    • For applying different conditions to the data to be generated, counter can be used. For Example:
    • Declare a counter = 0 at start of method and use it as:
  3. Copy the generated data and store it in different Json files in UserService (or any other service depends on Project)

  4. Now Two Endpoints(CreateTestData for Inserting Data in DataBase and DeleteTestData for Deleting Data from Database) are to be created in Same Service(user Service or any other as per project) where data is stored

    • Demo Endpoint
  5. Implementing Dapper

    1. In Configuration folder of that Service (User Service/ any other), create a new file as DapperContent and define DapperContent and CreateConnection
    2. In main configuration file of that service add DapperContent, it’s Interface class file(herenamed as IUserRepository) and Interface Implementation File (here named as UserRepository) to scope
    3. The Interface Implementation file contains the method which will be called in CreateTestdata and DeleteTestData Endpoint. Here DeleteTestEquipments contains the code for deleting Data from database and CreateTestEquipments contains code from inserting data in database. Details of both discussed below.
  6. CreateTestData Endpoint

    1. In the endpoint, call the data inserting method (here named as CreateTestEquipments)
    2. Data Inserting Method: Read data from the Json files and deserialize it.
    3. Create a loop to store the required data in different list, those lists data will be inserted to the required database.
    4. Create DAPPER CONNECTION and insert data into Database for all Tables (Regarding Implementing Dapper in that Service, Please check aboveStep.)
  7. DeleteTestDate Endpoint

    1. In the Endpoint, Call the Data Inserting method (here named as DeleteTestEquipments)
    2. Data Deleting method: Collect the Required Ids from Json File and DataBase(via Dapper. Create Dapper Connection before using Query) through which Data can be deleted
    3. Create a Dapper Connection(if not created in above step) and Write Delete Query