Beispiel #1
0
 public void ValueByTypeTest()
 {
     Assert.AreEqual(IsoGender.NotKnown, GetEnum.Value(typeof(IsoGender), 0));
     Assert.AreEqual(IsoGender.Male, GetEnum.Value(typeof(IsoGender), 1));
     Assert.AreEqual(IsoGender.Female, GetEnum.Value(typeof(IsoGender), 2));
     Assert.AreEqual(IsoGender.NotApplicable, GetEnum.Value(typeof(IsoGender), 3));
 }
Beispiel #2
0
 public void ValueTest()
 {
     Assert.AreEqual(IsoGender.NotKnown, GetEnum.Value <IsoGender>(0));
     Assert.AreEqual(IsoGender.Male, GetEnum.Value <IsoGender>(1));
     Assert.AreEqual(IsoGender.Female, GetEnum.Value <IsoGender>(2));
     Assert.AreEqual(IsoGender.NotApplicable, GetEnum.Value <IsoGender>(3));
 }
Beispiel #3
0
    public void MoveBirbAndCloseModal(GetEnum ge)
    {
        //TODO: come up with a better system for all popups
        switch (currentLocation)
        {
        case Enums.BirbLocation.Aviary:
            GameObject.FindGameObjectWithTag("AviaryHandler").GetComponent <AviaryHandler>().MoveBirbInBirbList(index, ge.state);
            break;

        case Enums.BirbLocation.NestParent:
            GameObject.FindGameObjectWithTag("BreedingHandler").GetComponent <BreedingHandler>().MoveBirbInBirbList(index, ge.state);
            break;

        case Enums.BirbLocation.Collection:
            GameObject.FindGameObjectWithTag("CollectionHandler").GetComponent <CollectionHandler>().MoveBirbInBirbList(index, ge.state);
            break;

        case Enums.BirbLocation.NestHatching:
            GameObject.FindGameObjectWithTag("HatchingHandler").GetComponent <HatchingHandler>().MoveBirbInBirbList(index, ge.state);
            break;

        default:
            Debug.Log("Something went wrong");
            break;
        }

        Destroy(this.gameObject);
    }
Beispiel #4
0
        public static object Enum(Type t)
        {
            var count = GetEnum.Count(t);
            var index = Int32(0, count);

            return(GetEnum.Value(t, index));
        }
Beispiel #5
0
 //during turn
 public void TryTradeCardsForTrapCard(GetEnum g)
 {
     if (playPhase && HasEnoughCards(g.state, amountOfCardsPerTrapCard))
     {
         RemoveCards(amountOfCardsPerTrapCard, g.state);
         GameObject tc = Instantiate(trapCardPrefab, Vector3.zero, Quaternion.identity);
         tc.transform.SetParent(trapCardParent);
         trapCards.Add(tc.GetComponent <TrapCard>().GetNewTrapCard());
     }
 }
Beispiel #6
0
    public void DiscardCard(GetEnum g)
    {
        if (g.state == CardType.None)
        {
            return;
        }

        discardPile.discardCards.Add(new Card(g.state));
        CheckWinAndUpdateUI();
    }
Beispiel #7
0
        public void TestEnumProperty <T>(Func <T> get, Action <T> set)
        {
            Assert.IsTrue(typeof(T).IsEnum);
            var i = GetEnum.Value <T>(0);

            Assert.AreEqual(i, get());
            var s = GetRandom.Enum <T>();

            set(s);
            Assert.AreEqual(s, get());
        }
Beispiel #8
0
 public void ValueByTypeTest()
 {
     Assert.AreEqual(EventType.Concert, GetEnum.Value(typeof(EventType), 0));
     Assert.AreEqual(EventType.Party, GetEnum.Value(typeof(EventType), 1));
     Assert.AreEqual(EventType.Sport, GetEnum.Value(typeof(EventType), 2));
     Assert.AreEqual(EventType.Music, GetEnum.Value(typeof(EventType), 3));
     Assert.AreEqual(EventType.Theatre, GetEnum.Value(typeof(EventType), 4));
     Assert.AreEqual(EventType.Festival, GetEnum.Value(typeof(EventType), 5));
     Assert.AreEqual(EventType.Folk, GetEnum.Value(typeof(EventType), 6));
     Assert.AreEqual(EventType.Family, GetEnum.Value(typeof(EventType), 7));
     Assert.AreEqual(EventType.Exhibition, GetEnum.Value(typeof(EventType), 8));
     Assert.AreEqual(EventType.Other, GetEnum.Value(typeof(EventType), 9));
 }
Beispiel #9
0
 public void ValueTest()
 {
     Assert.AreEqual(EventType.Concert, GetEnum.Value <EventType>(0));
     Assert.AreEqual(EventType.Party, GetEnum.Value <EventType>(1));
     Assert.AreEqual(EventType.Sport, GetEnum.Value <EventType>(2));
     Assert.AreEqual(EventType.Music, GetEnum.Value <EventType>(3));
     Assert.AreEqual(EventType.Theatre, GetEnum.Value <EventType>(4));
     Assert.AreEqual(EventType.Festival, GetEnum.Value <EventType>(5));
     Assert.AreEqual(EventType.Folk, GetEnum.Value <EventType>(6));
     Assert.AreEqual(EventType.Family, GetEnum.Value <EventType>(7));
     Assert.AreEqual(EventType.Exhibition, GetEnum.Value <EventType>(8));
     Assert.AreEqual(EventType.Other, GetEnum.Value <EventType>(9));
 }
Beispiel #10
0
 public void CountTest()
 {
     Assert.AreEqual(10, GetEnum.Count <EventType>());
     Assert.AreEqual(-1, GetEnum.Count <object>());
 }
Beispiel #11
0
 public void CountByTypeTest()
 {
     Assert.AreEqual(10, GetEnum.Count(typeof(EventType)));
     Assert.AreEqual(-1, GetEnum.Count(typeof(object)));
 }
Beispiel #12
0
 [TestMethod] public void NumberOfElementsTest()
 {
     Assert.AreEqual(39, GetEnum.Count <Operation>());
 }
 public void CountTest()
 {
     Assert.AreEqual(7, GetEnum.Count <MoneyOperation>());
 }
 public void CountTest()
 {
     Assert.AreEqual(3, GetEnum.Count <TransactionStatus>());
 }
Beispiel #15
0
 public void CountTest()
 {
     Assert.AreEqual(2, GetEnum.Count <SortOrder>());
 }
 public void CountTest()
 {
     Assert.AreEqual(7, GetEnum.Count <RoundingStrategy>());
 }
Beispiel #17
0
 [TestMethod] public void ValueByValueTestByTypeWrongType()
 => Assert.AreEqual(0, GetEnum.ValueByValue(typeof(int), 100));
 public void CountTest()
 {
     Assert.AreEqual(4, GetEnum.Count <InsuranceType>());
 }
Beispiel #19
0
 public void CountTest()
 {
     Assert.AreEqual(3, GetEnum.Count <CardType>());
 }
Beispiel #20
0
 [TestMethod] public void CountTest()
 {
     Assert.AreEqual(5, GetEnum.Count <TelecomDevice>());
 }
Beispiel #21
0
 [TestMethod] public void ValueByValueTestWrongType()
 => Assert.AreEqual(0, GetEnum.ValueByValue <int>(100));
Beispiel #22
0
 [TestMethod] public void ValueByIndexTestWrongType()
 => Assert.AreEqual(null, GetEnum.ValueByIndex <string>(100));
Beispiel #23
0
 [TestMethod] public void ValueByIndexTestByTypeWrongType()
 => Assert.AreEqual(null, GetEnum.ValueByIndex(typeof(string), 100));
Beispiel #24
0
 [TestMethod] public void CountTest()
 {
     Assert.AreEqual(4, GetEnum.Count <IsoGender>());
     Assert.AreEqual(-1, GetEnum.Count <object>());
 }
Beispiel #25
0
 public void CountTest()
 {
     Assert.AreEqual(8, GetEnum.Count <ItemCategory>());
 }
Beispiel #26
0
 public void CountByTypeTest()
 {
     Assert.AreEqual(4, GetEnum.Count(typeof(IsoGender)));
     Assert.AreEqual(-1, GetEnum.Count(typeof(object)));
 }
Beispiel #27
0
 public void CountTest()
 {
     Assert.AreEqual(2, GetEnum.Count <Status>());
 }
 [TestMethod] public void CountTest()
 {
     Assert.AreEqual(6, GetEnum.Count <PartyNameType>());
 }
Beispiel #29
0
 public void CountTest()
 {
     Assert.AreEqual(4, GetEnum.Count <IsoGender>());
 }
 public void CountTest()
 {
     Assert.AreEqual(1, GetEnum.Count <PricingStrategy>());
 }