From 78db4c2922f90fed960279af28b7581eceb73659 Mon Sep 17 00:00:00 2001 From: raspopov Date: Sun, 28 Dec 2025 19:53:34 +0300 Subject: [PATCH] Fix a bug in the test The variable that counted the number of responses to requests was not cleared between tests. This caused incorrect counting if the order of the tests was changed. --- CoAP.Test/CoapClientTest.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CoAP.Test/CoapClientTest.cs b/CoAP.Test/CoapClientTest.cs index fa173db..c8fe709 100644 --- a/CoAP.Test/CoapClientTest.cs +++ b/CoAP.Test/CoapClientTest.cs @@ -69,6 +69,7 @@ public void TestSynchronousCall() // Observe the resource _expected = CONTENT_2; + _notifications = 0; CoapObserveRelation obs1 = client.Observe(response => { Interlocked.Increment(ref _notifications); @@ -142,6 +143,7 @@ public void TestAsynchronousCall() Thread.Sleep(100); // Observe the resource + _notifications = 0; _expected = CONTENT_2; CoapObserveRelation obs1 = client.ObserveAsync(response => {