public void TestEmptyExcept()
    {
        MultiSet<string> a = new MultiSet<string>();
        MultiSet<string> b = new MultiSet<string>();

        MultiSet<string> diff = a.Except(b);
        Assert.AreEqual<int>(0, diff.Count);
    }
 public bool Equals(MultiSet <T> other)
 {
     if (other == null)
     {
         return(false);
     }
     return((Except(other).Count == 0) && (other.Except(this).Count == 0));
 }
Exemple #3
0
    public void TestEmptyExcept()
    {
        MultiSet <string> a = new MultiSet <string>();
        MultiSet <string> b = new MultiSet <string>();

        MultiSet <string> diff = a.Except(b);

        Assert.AreEqual <int>(0, diff.Count);
    }
Exemple #4
0
    public void TestExcept()
    {
        MultiSet <String> requirements = new MultiSet <string>();

        requirements.Add("DAIRY");
        requirements.Add("PLANT");
        requirements.Add("PLANT");

        MultiSet <String> available = new MultiSet <string>();

        available.Add("PLANT");
        available.Add("PLANT");
        available.Add("DAIRY");

        Assert.AreEqual(requirements.Except(available), new MultiSet <string>());
        Assert.AreEqual(available.Except(requirements), new MultiSet <String>());
    }
    public void TestExcept()
    {
        MultiSet<String> requirements = new MultiSet<string>();
        requirements.Add("DAIRY");
        requirements.Add("PLANT");
        requirements.Add("PLANT");

        MultiSet<String> available = new MultiSet<string>();
        available.Add("PLANT");
        available.Add("PLANT");
        available.Add("DAIRY");

        Assert.AreEqual(requirements.Except(available), new MultiSet<string>());
        Assert.AreEqual(available.Except(requirements), new MultiSet<String>());
    }