Skip to content

Commit

Permalink
Unit Test Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dbretty committed Sep 25, 2024
1 parent 56ac36c commit 3aa4a92
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
56 changes: 56 additions & 0 deletions PROFiLiX.Common.Tests/Profile/ProfileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,62 @@ public void ExecuteAction_WithResetEdge_ShouldSucceed()
Assert.DoesNotThrow(() => mockUserProfile.ExecuteAction(ProfileActionDefinition.ResetEdge, "test", mockUserProfile));
}

/// <summary>
/// Test method to ensure ExecuteAction with valid data succeeds.
/// </summary>
[Test]
public void ExecuteAction_WithResetChrome_ShouldSucceed()
{
// Arrange
var mockLogger = new Mock<ILogger>();
var mockFilesAndFolders = new Mock<IFilesAndFolders>();
var mockUserProfile = new UserProfile(mockLogger.Object, mockFilesAndFolders.Object);

Assert.DoesNotThrow(() => mockUserProfile.ExecuteAction(ProfileActionDefinition.ResetChrome, "test", mockUserProfile));
}

/// <summary>
/// Test method to ensure ExecuteAction with valid data succeeds.
/// </summary>
[Test]
public void ExecuteAction_WithResetMozilla_ShouldSucceed()
{
// Arrange
var mockLogger = new Mock<ILogger>();
var mockFilesAndFolders = new Mock<IFilesAndFolders>();
var mockUserProfile = new UserProfile(mockLogger.Object, mockFilesAndFolders.Object);

Assert.DoesNotThrow(() => mockUserProfile.ExecuteAction(ProfileActionDefinition.ResetFirefox, "test", mockUserProfile));
}

/// <summary>
/// Test method to ensure ExecuteAction with valid data succeeds.
/// </summary>
[Test]
public void ExecuteAction_WithResetTeamsClassic_ShouldSucceed()
{
// Arrange
var mockLogger = new Mock<ILogger>();
var mockFilesAndFolders = new Mock<IFilesAndFolders>();
var mockUserProfile = new UserProfile(mockLogger.Object, mockFilesAndFolders.Object);

Assert.DoesNotThrow(() => mockUserProfile.ExecuteAction(ProfileActionDefinition.ResetTeamsv1, "test", mockUserProfile));
}

/// <summary>
/// Test method to ensure ExecuteAction with valid data succeeds.
/// </summary>
[Test]
public void ExecuteAction_WithResetTeams_ShouldSucceed()
{
// Arrange
var mockLogger = new Mock<ILogger>();
var mockFilesAndFolders = new Mock<IFilesAndFolders>();
var mockUserProfile = new UserProfile(mockLogger.Object, mockFilesAndFolders.Object);

Assert.DoesNotThrow(() => mockUserProfile.ExecuteAction(ProfileActionDefinition.ResetTeamsv2, "test", mockUserProfile));
}

/// <summary>
/// Checks that ProfileAction returns string value.
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions PROFiLiX.Common/ApiClient/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@

namespace PROFiLiX.Common.ApiClient
{

using System = global::System;

[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Client
{
Expand Down Expand Up @@ -409,6 +411,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu
}
}

[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ProfilixTaskClient
{
Expand Down Expand Up @@ -1137,6 +1140,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu
}
}

[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class UserProfileClient
{
Expand Down Expand Up @@ -1882,6 +1886,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu
/// <summary>
/// Class for the EUC Profile Buddy Task model.
/// </summary>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ProfilixTask
{
Expand Down Expand Up @@ -1944,6 +1949,7 @@ public enum ProfilixTaskState
/// Class for the user profile model.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class UserProfile
{
/// <summary>
Expand Down Expand Up @@ -2074,6 +2080,7 @@ public enum ProfileType


[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class ApiException : System.Exception
{
public int StatusCode { get; private set; }
Expand All @@ -2097,6 +2104,7 @@ public override string ToString()
}

[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public partial class ApiException<TResult> : ApiException
{
public TResult Result { get; private set; }
Expand Down

0 comments on commit 3aa4a92

Please sign in to comment.