Beef icon indicating copy to clipboard operation
Beef copied to clipboard

membersToIgnore parameter of ExpectEvent<T>( ) doesn't work

Open leandrodotec opened this issue 3 years ago • 0 comments

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

leandrodotec avatar Oct 05 '22 21:10 leandrodotec