Example #1
0
        public void Test_We_Get_Valid_GUID()
        {
            MultiBool mb     = new MultiBool();
            Guid      actual = mb.addFalse();

            Assert.IsNotNull(actual, "We didn't receive a guid for adding a false to our multibool");
        }
Example #2
0
        public void Test_Is_True_When_Receive_A_Guid_And_Remove()
        {
            MultiBool mb       = new MultiBool();
            Guid      returned = mb.addFalse();

            mb.setTrue(returned);
            Assert.AreEqual(true, mb.Truthiness, "Truthiness of multibool should be true, got false");
        }
Example #3
0
        public void Test_Is_False_When_Receive_A_Guid()
        {
            MultiBool mb       = new MultiBool();
            Guid      returned = mb.addFalse();

            Assert.IsTrue(mb.Truthiness, "Truthiness of multibool should not be true");
            //Assert.AreEqual(false, mb.Truthiness, "Truthiness of multibool should not be true");
        }
Example #4
0
    public static MultiBool WithMax(int max, bool defaultValue)
    {
        MultiBool b = new MultiBool(defaultValue);

        b.hasMax = true;
        b.max    = max;
        return(b);
    }
Example #5
0
    public static MultiBool WithMin(int min, bool defaultValue)
    {
        MultiBool b = new MultiBool(defaultValue);

        b.hasMin = true;
        b.min    = min;
        return(b);
    }
Example #6
0
    public static MultiBool WithMinAndMax(int min, int max, bool defaultValue)
    {
        MultiBool b = new MultiBool(defaultValue);

        b.hasMin = true;
        b.hasMax = true;
        if (min <= max)
        {
            b.min = min;
            b.max = max;
        }
        else
        {
            b.min = max;
            b.max = min;
        }
        return(b);
    }
Example #7
0
        public void Test_Use_Case()
        {
            MultiBool mb = new MultiBool();

            Assert.WorksFor <MultiBool>(mb, (multi) =>
            {
                List <Guid> guids = new List <Guid>();
                for (int i = 0; i < 50; i++)
                {
                    guids.Add(mb.addFalse());
                    if (mb.Truthiness == true)
                    {
                        return(false);
                    }
                }

                foreach (Guid g in guids)
                {
                    mb.setTrue(g);
                }

                return(mb.Truthiness);
            });
        }