Skip to content

Commit e31ec0a

Browse files
### Summary of Most Important Changes: The solution file BlazorTicketmasterApp.sln and README.md have been significantly updated to include new project sections, descriptions, and CI/CD pipeline enhancements. The updates ensure better project organization, documentation, and automated testing and deployment processes.
### List of Changes 1. **Updated Visual Studio Version**: - The `VisualStudioVersion` in `BlazorTicketmasterApp.sln` was updated to `17.9.34728.123`. - **Reference**: `BlazorTicketmasterApp.sln` 2. **Added New Project Sections**: - Added a new project section for `BlazorTicketMasterApp.UnitTests` in the solution file. - Added a new project section for `Solution Items` in the solution file, including a reference to `README.md`. - **Reference**: `BlazorTicketmasterApp.sln` 3. **Updated README.md**: - Added descriptions for the restructured project components: - `BlazorTicketMasterApp.Shared`: Includes shared code and resources. - `BlazorTicketMasterApp`: Dedicated to unit tests. - `BlazorTicketMasterApp.UnitTests`: Includes unit tests and a custom HTTP message handler for mocking HTTP responses. - Updated the Continuous Integration (CI) section to include unit tests as part of the CI pipeline using GitHub Actions. - Added a new step in the CI process to run unit tests using the `dotnet test` command. - Updated the Continuous Deployment (CD) section to include configuration details for deploying to Azure App Service. - **Reference**: `README.md`
1 parent c8c6e89 commit e31ec0a

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

BazorTicketMasterApp/BlazorTicketmasterApp.sln

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorTicketmasterApp", "Bl
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorTicketMasterApp.Shared", "..\BlazorTicketMasterApp.Shared\BlazorTicketMasterApp.Shared.csproj", "{DA4286F3-9383-4446-902B-8A31925B07F9}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorTicketMasterApp.UnitTests", "..\BlazorTicketMasterApp.UnitTests\BlazorTicketMasterApp.UnitTests.csproj", "{87370C22-9249-4ADE-9145-322908B12079}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorTicketMasterApp.UnitTests", "..\BlazorTicketMasterApp.UnitTests\BlazorTicketMasterApp.UnitTests.csproj", "{87370C22-9249-4ADE-9145-322908B12079}"
11+
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{89074E17-BEF0-4026-91B9-4A11E8B552ED}"
13+
ProjectSection(SolutionItems) = preProject
14+
..\README.md = ..\README.md
15+
EndProjectSection
1116
EndProject
1217
Global
1318
GlobalSection(SolutionConfigurationPlatforms) = preSolution

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,24 @@ This project is a .NET application that interacts with the Ticketmaster API to f
7070

7171
## Project Structure
7272

73+
The project has been restructured to include the following components:
74+
75+
76+
- **BlazorTicketMasterApp.Shared**: A separate library project that contains shared code and resources.
77+
7378
- **Models**
7479
- `AttractionDto.cs`: Represents an attraction with associated events.
7580
- `EventDto.cs`: Represents an event with a foreign key to an attraction.
7681
- `ImageDto.cs`: Represents an image with a URL property.
7782
- `ExternaLldDto.cs`: Represent an external link with a URL property. It is used in the AttractionDto class.
83+
7884
- **Services**
7985
- `TicketmasterService.cs`: Contains methods to interact with the Ticketmaster API, including fetching attraction details, searching for attractions, and getting events by attraction ID.
8086
- `TicketmasterResponse.cs`: Contains the response from the Ticketmaster API.
8187

88+
89+
- **BlazorTicketMasterApp**: A separate project dedicated to unit tests.
90+
8291
- **Components**
8392
- `AttractionDetails.razor`: Displays details about an attraction, including its name, description, and events.
8493
- `AttractionList.razor`: Displays a list of attractions with their names and images.
@@ -97,6 +106,12 @@ This project is a .NET application that interacts with the Ticketmaster API to f
97106
- **Dockerfile**
98107
- `Dockerfile` is used to build a Docker image for the application. It copies the application files, restores the dependencies, and builds the application.
99108

109+
- **BlazorTicketMasterApp.UnitTests**: A separate project dedicated to unit tests.
110+
111+
- `CustomHttpMessageHandler.cs`: A custom HTTP message handler that allows mocking HTTP responses in unit tests.This class is used to mock the HttpMessageHandler class and expose the SendAsync method as a Func as part of the public properties
112+
- `TicketmasterServiceTests.cs`: Contains unit tests for the TicketmasterService class. It includes tests for fetching attraction details, searching for attractions, and getting events by attraction ID. This test class uses the CustomHttpMessageHandler class to mock HTTP responses.
113+
and more.It was included in the project to demostrate how to write unit tests for the project. It runs as part of the CI Pipeline in GitHub Actions.
114+
100115
## Steps to Deploy the Solution Locally.
101116

102117
1. **Clone the Repository**
@@ -133,6 +148,14 @@ This project is configured for Continuous Integration (CI) and Continuous Deploy
133148
1. **Configure GitHub Actions for CI**:
134149
- Ensure you have a `.github/workflows` directory in your repository.
135150
- Add a workflow YAML file (`master_blazorticketmasterapp.yml`) to define the CI process.
151+
- The GitHub Actions workflow has been updated to include unit tests as part of the CI pipeline.
152+
153+
name: Run Unit Tests
154+
run: dotnet test BlazorTicketMasterApp.UnitTests/BlazorTicketMasterApp.UnitTests.csproj --verbosity normal
155+
156+
This ensures that every push and pull request to the `Master` branch will trigger the CI pipeline, which includes building the project and running the unit tests.
157+
158+
### Continuous Deployment (CD)
136159

137160
2. **Configure Azure App Service Deployment Center**:
138161
- An Azure App Service is required to deploy the application.This was done manually in the Azure Portal.

0 commit comments

Comments
 (0)