Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am checking a log entry and I am in a dilemma what best to use

assert.single or assert.notempty

Assert.Single(Logs.GetPlayerLogs(user, group)
				.Where(l => l.Severity == LogSeverity.Info && l.Category == LogCategory.Verbose
					&& l.Line.Contains("Dump Created") && !l.Line.Contains("JPC:")));


What I have tried:

both
Assert.Single
and
Assert.NotEmpty
Posted
Updated 3-Feb-22 21:09pm
Comments
[no name] 5-Feb-22 12:14pm    
If it's a "single", why use .Where() instead of .Single() or .SingleOrDefault()?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900