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

Verify navigation does not work when parameters are complex type #10

Open
Axemasta opened this issue Jan 10, 2025 · 0 comments
Open

Verify navigation does not work when parameters are complex type #10

Axemasta opened this issue Jan 10, 2025 · 0 comments

Comments

@Axemasta
Copy link
Owner

I've found the following navigation action could not be verified:

await navigationService.CreateBuilder()
	.AddParameter(ParameterConstants.SelectedLogbooks, selectedLogbooks)
	.AddParameter(ParameterConstants.DownloadSource, DownloadSource.Settings)
	.AddSegment<DownloadLogbookViewModel>()
	.NavigateAsync();

Given the above example, I would expect the following expression should be able to verify the navigation:

navigationService.VerifyNavigation(nav =>
	nav.CreateBuilder()
		.AddParameter(ParameterConstants.SelectedLogbooks, new List<Logbook>()
		{
			new()
			{
				Id = 27,
				Name = "Logbook",
				Enabled = true,
			}
		})
		.AddParameter(ParameterConstants.DownloadSource, DownloadSource.Settings)
		.AddSegment<DownloadLogbookViewModel>()
		.NavigateAsync());

Instead we see a moq exception:

Moq.VerifyNavigationException
Verification failed
Expected invocation on the mock at least once, but was never performed: nav => nav.CreateBuilder().AddParameter("SelectedLogbooks", new List<Logbook>() { { new Logbook() { Id= 27, Name= "F2 Chronolog", Enabled= True, Type= LogbookType.Chronological } } }).AddParameter("DownloadSource", (object)DownloadSource.Settings).AddSegment<DownloadLogbookViewModel>().NavigateAsync()

If I remove the .AddParameter(ParameterConstants.SelectedLogbooks, new List<Logbook>()... code from both sides the verification succeeds. This looks like the verify expression for the list isn't working.

Axemasta added a commit that referenced this issue Jan 10, 2025
Reproduced the issue reported in #10 via the unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant