Ejemplo n.º 1
0
    public void Test_S1IntervalTestBase_ConstructorsAndAccessors()
    {
        // Spot-check the constructors and accessors.
        Assert.Equal(0, quad12.Lo);
        Assert.Equal(quad12.Hi, Math.PI);
        Assert.Equal(quad34[0], Math.PI);
        Assert.Equal(0, quad34[1]);
        Assert.Equal(quad34.Bounds(), new R2Point(Math.PI, 0).Bounds());
        Assert.Equal(pi.Lo, Math.PI);
        Assert.Equal(pi.Hi, Math.PI);

        // Check that [-Pi, -Pi] is normalized to [Pi, Pi].
        Assert.Equal(mipi.Lo, Math.PI);
        Assert.Equal(mipi.Hi, Math.PI);
        Assert.Equal(quad23.Lo, S2.M_PI_2);
        Assert.Equal(quad23.Hi, -S2.M_PI_2);

        // Check that the default S1Interval is identical to Empty().
        S1Interval default_empty = S1Interval.Empty;

        Assert.True(default_empty.IsValid());
        Assert.True(default_empty.IsEmpty());
        Assert.Equal(empty.Lo, default_empty.Lo);
        Assert.Equal(empty.Hi, default_empty.Hi);
    }
Ejemplo n.º 2
0
 public void Test_S1IntervalTestBase_SimplePredicates()
 {
     // is_valid(), IsEmpty, IsFull, IsInverted
     Assert.True(zero.IsValid() && !zero.IsEmpty() && !zero.IsFull());
     Assert.True(empty.IsValid() && empty.IsEmpty() && !empty.IsFull());
     Assert.True(empty.IsInverted());
     Assert.True(full.IsValid() && !full.IsEmpty() && full.IsFull());
     Assert.True(!quad12.IsEmpty() && !quad12.IsFull() && !quad12.IsInverted());
     Assert.True(!quad23.IsEmpty() && !quad23.IsFull() && quad23.IsInverted());
     Assert.True(pi.IsValid() && !pi.IsEmpty() && !pi.IsInverted());
     Assert.True(mipi.IsValid() && !mipi.IsEmpty() && !mipi.IsInverted());
 }