Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order of Assert.AreEqual parameters #31

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ namespace BookmarkSync.Infrastructure.Tests.Services;
public class BookmarkingServiceTests
{
[TestMethod]
public void GetBookmarkingService_Pinboard()
[ExpectedException(typeof(InvalidOperationException))]
public void GetBookmarkingService_Exception()
{
// Arrange
var config = new Dictionary<string, string?>
{
{
"App:Bookmarking:Service", "Pinboard"
},
{
"App:Bookmarking:ApiToken", "secret:123456789"
"App:Bookmarking:Service", "Nonsense"
}
};
var configuration = new ConfigurationBuilder()
Expand All @@ -28,21 +26,21 @@ public void GetBookmarkingService_Pinboard()
IConfigManager configManager = new ConfigManager(configuration);

// Act
var obj = BookmarkingService.GetBookmarkingService(configManager);
var unused = BookmarkingService.GetBookmarkingService(configManager);

// Assert
Assert.AreEqual(obj.GetType(), typeof(PinboardBookmarkingService));
Assert.IsInstanceOfType(obj, typeof(PinboardBookmarkingService));
// Assert - Exception
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
public void GetBookmarkingService_Exception()
public void GetBookmarkingService_Pinboard()
{
// Arrange
var config = new Dictionary<string, string?>
{
{
"App:Bookmarking:Service", "Nonsense"
"App:Bookmarking:Service", "Pinboard"
},
{
"App:Bookmarking:ApiToken", "secret:123456789"
}
};
var configuration = new ConfigurationBuilder()
Expand All @@ -52,8 +50,10 @@ public void GetBookmarkingService_Exception()
IConfigManager configManager = new ConfigManager(configuration);

// Act
var unused = BookmarkingService.GetBookmarkingService(configManager);
var obj = BookmarkingService.GetBookmarkingService(configManager);

// Assert - Exception
// Assert
Assert.AreEqual(typeof(PinboardBookmarkingService), obj.GetType());
Assert.IsInstanceOfType(obj, typeof(PinboardBookmarkingService));
}
}