Skip to content

Commit 9c10fde

Browse files
committed
Improved test coverage
1 parent fc728d8 commit 9c10fde

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/DotNext.Tests/Threading/AtomicContainerTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,18 @@ public static void StringConversion()
9393
var container = new Atomic<decimal> { Value = 42M };
9494
Equal(42M.ToString(), container.ToString());
9595
}
96+
97+
[Fact]
98+
public static void SwapValues()
99+
{
100+
var x = new Atomic<int> { Value = 42 };
101+
var y = new Atomic<int> { Value = 43 };
102+
103+
Equal(42, x.Value);
104+
Equal(43, y.Value);
105+
106+
x.Swap(ref y);
107+
Equal(43, x.Value);
108+
Equal(42, y.Value);
109+
}
96110
}

0 commit comments

Comments
 (0)