Unplanned
Last Updated: 13 May 2021 08:42 by ADMIN
aditya
Created on: 12 May 2021 21:13
Type: Bug Report
1
AssertFailedException - JustMock xUnit method occurrence intermittently fails

We are trying to run unit tests via xUnit and mocking method occurence using JustMockLite. Method under arrange is creating a underlying Task however, once in a while test fails with following error

 


build	11-May-2021 14:36:09	               Telerik.JustMock.Xunit.AssertFailedException : Multiple assertion failures:
build	11-May-2021 14:36:09	               1. Occurrence expectation failed. Expected exactly 1 call. Calls so far: 0
build	11-May-2021 14:36:09	         Arrange expression: x => x.CallAsync(IsAny(), IsAny())
build	11-May-2021 14:36:09	               2. Occurrence expectation failed. Expected exactly 1 call. Calls so far: 0
build	11-May-2021 14:36:09	         Arrange expression: x => x.NotifyAsync(IsAny())
build	11-May-2021 14:36:09	               
build	11-May-2021 14:36:09	               ---- Telerik.JustMock.Diagnostics.DebugViewDetailsException : State:
build	11-May-2021 14:36:09	         Elevated mocking: disabled
build	11-May-2021 14:36:09	         
build	11-May-2021 14:36:09	         Arrangements and expectations:
build	11-May-2021 14:36:09	                   Arrangement (id=0) x => x.Load(IsAny()):
build	11-May-2021 14:36:09	                 Met: Occurences must be in [1, 1]; calls so far: 1. 
build	11-May-2021 14:36:09	             Arrangement (id=1) x => x.InitializePolicy(IsAny(), IsAny()):
build	11-May-2021 14:36:09	                 Met: Occurences must be in [1, 1]; calls so far: 1. 
build	11-May-2021 14:36:09	             Arrangement (id=2) x => x.RequestBulkSync(IsAny(), IsAny(), IsAny()):
build	11-May-2021 14:36:09	                 Met: Occurences must be in [any, 1]; calls so far: 1. 
build	11-May-2021 14:36:09	             Arrangement (id=3) x => x.CallAsync(IsAny(), IsAny()):
build	11-May-2021 14:36:09	                 Unmet: Occurences must be in [1, 1]; calls so far: 0. 
build	11-May-2021 14:36:09	             Arrangement (id=4) x => x.NotifyAsync(IsAny()):
build	11-May-2021 14:36:09	                 Unmet: Occurences must be in [1, 1]; calls so far: 0. 
build	11-May-2021 14:36:09	         
build	11-May-2021 14:36:09	         Invocations:

1 comment
ADMIN
Ivo
Posted on: 13 May 2021 08:42

Hi Aditia,

Let us communicate via the logged issue on GitHub.

Regards,
Ivo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.