Esempio n. 1
0
    public void UnsafeHashSet_EIU_IntersectWith_Empty()
    {
        var setA = new UnsafeHashSet <int>(8, Allocator.TempJob)
        {
        };
        var setB = new UnsafeHashSet <int>(8, Allocator.TempJob)
        {
        };

        setA.IntersectWith(setB);

        ExpectedCount(ref setA, 0);

        setA.Dispose();
        setB.Dispose();
    }
Esempio n. 2
0
    public void UnsafeHashSet_EIU_IntersectWith()
    {
        var setA = new UnsafeHashSet <int>(8, Allocator.TempJob)
        {
            0, 1, 2, 3, 4, 5
        };
        var setB = new UnsafeHashSet <int>(8, Allocator.TempJob)
        {
            3, 4, 5, 6, 7, 8
        };

        setA.IntersectWith(setB);

        ExpectedCount(ref setA, 3);
        Assert.True(setA.Contains(3));
        Assert.True(setA.Contains(4));
        Assert.True(setA.Contains(5));

        setA.Dispose();
        setB.Dispose();
    }