Exemple #1
0
        public void ContainsOnly_WithMatchingCustomMatcher_DoesNotAssert()
        {
            m_Manager.CreateEntity();

            Assert.DoesNotThrow(() =>
                                EntitiesAssert.ContainsOnly(m_Manager, EntityMatch.Where(() => "Matcher #0", _ => true)));
        }
Exemple #2
0
        public void ContainsOnly_WithCustomMatcher_OnlyCalledOnce()
        {
            m_Manager.CreateEntity();
            m_Manager.CreateEntity();

            var(count0, count1) = (0, 10);
            Assert.DoesNotThrow(() =>
                                EntitiesAssert.ContainsOnly(m_Manager,
                                                            EntityMatch.Where(() => "Matcher #0", _ => { ++count0; return(true); }),
                                                            EntityMatch.Where(() => "Matcher #1", _ => { ++count1; return(true); })));

            Assert.AreEqual(1, count0);
            Assert.AreEqual(11, count1);
        }
Exemple #3
0
 public void ContainsOnly_WithEmptyEcs_Asserts()
 {
     Assert.Throws <AssertionException>(() =>
                                        EntitiesAssert.ContainsOnly(m_Manager, EntityMatch.Where(() => "", _ => true)));
 }
Exemple #4
0
        public void ContainsOnly_WithNonMatchingCustomMatcher_Asserts()
        {
            m_Manager.CreateEntity();

            var ex = Assert.Throws <AssertionException>(() =>
                                                        EntitiesAssert.ContainsOnly(m_Manager, EntityMatch.Where(() => "Matcher #0", _ => false)));

            StringAssert.Contains("Matcher #0", ex.Message);
        }