Beef
Beef copied to clipboard
membersToIgnore parameter of ExpectEvent<T>( ) doesn't work
Hi, ExpectEvent<T>( ) doesn't ignore the members when passing membersToIgnore parameter:
v = agentTester.Test<EmployeeAgent, Employee>()
.ExpectStatusCode(HttpStatusCode.Created)
.ExpectChangeLogCreated()
.ExpectETag()
.ExpectUniqueKey()
.ExpectValue(_ => v)
.ExpectEvent<My.Hr.Business.Entities.Employee>("my.hr.employee", "created", expectedEventValue, "ETag", "ChangeLog", "Id", "EmergencyContacts[0].Id")
.Run(a => a.CreateAsync(v)).Value!;
Fails with:
Expected sent Event[0].Value is not equal to actual sent:
Begin Differences (4 differences):
Types [Guid,Guid], Item Expected.EmergencyContacts[0].Id != Actual.EmergencyContacts[0].Id, Values (00000000-0000-0000-0000-000000000000,e6dfedfa-f644-ed11-89fa-747827c5b847)
Types [null,String], Item Expected.ETag != Actual.ETag, Values ((null),"AAAAAAAAC0s=")
Types [null,ChangeLog], Item Expected.ChangeLog != Actual.ChangeLog, Values ((null),Beef.Entities.ChangeLog)
Types [Guid,Guid], Item Expected.Id != Actual.Id, Values (00000000-0000-0000-0000-000000000000,e5dfedfa-f644-ed11-89fa-747827c5b847)
I have just made a pull request with the possible fix. Please have a look:
https://github.com/Avanade/Beef/pull/190