63 lines
1.6 KiB
C#
63 lines
1.6 KiB
C#
using Encompass.Collections;
|
|
using FluentAssertions;
|
|
using NUnit.Framework;
|
|
|
|
namespace Tests
|
|
{
|
|
public class BitSet512Test
|
|
{
|
|
[Test]
|
|
public void Zeroes()
|
|
{
|
|
var bitSet = BitSet512Builder.Zeroes();
|
|
bitSet.AllFalse().Should().BeTrue();
|
|
}
|
|
|
|
[Test]
|
|
public void Ones()
|
|
{
|
|
var bitSet = BitSet512Builder.Ones();
|
|
bitSet.AllTrue().Should().BeTrue();
|
|
}
|
|
|
|
[Test]
|
|
public void Set()
|
|
{
|
|
var bitSet = BitSet512Builder.Zeroes().Set(5);
|
|
bitSet.AllFalse().Should().BeFalse();
|
|
|
|
bitSet = BitSet512Builder.Zeroes().Set(132);
|
|
bitSet.AllFalse().Should().BeFalse();
|
|
|
|
bitSet = BitSet512Builder.Zeroes().Set(268);
|
|
bitSet.AllFalse().Should().BeFalse();
|
|
|
|
bitSet = BitSet512Builder.Zeroes().Set(450);
|
|
bitSet.AllFalse().Should().BeFalse();
|
|
}
|
|
|
|
[Test]
|
|
public void UnSet()
|
|
{
|
|
var bitSet = BitSet512Builder.Ones().UnSet(285);
|
|
bitSet.Get(285).Should().BeFalse();
|
|
bitSet.Set(285).AllTrue().Should().BeTrue();
|
|
}
|
|
|
|
[Test]
|
|
public void Get()
|
|
{
|
|
var bitSet = BitSet512Builder.Zeroes().Set(359);
|
|
bitSet.Get(359).Should().BeTrue();
|
|
bitSet.UnSet(359).AllFalse().Should().BeTrue();
|
|
}
|
|
|
|
[Test]
|
|
public void Not()
|
|
{
|
|
var bitSet = BitSet512Builder.Ones().Not();
|
|
bitSet.AllFalse().Should().BeTrue();
|
|
}
|
|
}
|
|
}
|