Пример #1
0
 public static void IsNotListTest(Action <bool, string> assertTrue)
 {
     InterfacePropertyTestProgram.Execute(() =>
     {
         dotMemory.Check(memory =>
         {
             var objectSet     = memory.GetObjects(where => where.Interface.IsNot(typeof(InterfacePropertyTestProgram.I1), typeof(InterfacePropertyTestProgram.I2)));
             var expectedCount = memory.ObjectsCount - InterfacePropertyTestProgram.C12.Count - InterfacePropertyTestProgram.C2.Count;
             assertTrue(objectSet.ObjectsCount == expectedCount, string.Format(AssertTemplates.AssertObjectsCountTemplate, expectedCount, objectSet.ObjectsCount));
             assertTrue(objectSet.SizeInBytes > 0, string.Format(AssertTemplates.AssertSizeInBytesTemplate, objectSet.SizeInBytes));
         });
     },
                                          () => { }
                                          );
 }
Пример #2
0
 public static void KollectionTest(Type type, Action <bool, string> assertTrue)
 {
     InterfacePropertyTestProgram.Execute(() =>
     {
         dotMemory.Check(memory =>
         {
             var objectSet     = memory.GetObjects(where => where.Interface.Is(type));
             var expectedCount = InterfacePropertyTestProgram.KCollection.Count * 2;
             assertTrue(objectSet.ObjectsCount == expectedCount, string.Format(AssertTemplates.AssertObjectsCountTemplate, expectedCount, objectSet.ObjectsCount));
             assertTrue(objectSet.SizeInBytes > 0, string.Format(AssertTemplates.AssertSizeInBytesTemplate, objectSet.SizeInBytes));
         });
     },
                                          () => { }
                                          );
 }
Пример #3
0
        public static void MultiInheritanceInterfaceIsTest(Action <bool, string> assertTrue)
        {
            InterfacePropertyTestProgram.Execute(() =>
            {
                dotMemory.Check(memory =>
                {
                    var objectSet = memory.GetObjects(_ => _.Interface.Is <InterfacePropertyTestProgram.I2>());

                    const int expectedCount = InterfacePropertyTestProgram.C12.Count + InterfacePropertyTestProgram.C2.Count;
                    assertTrue(objectSet.ObjectsCount == expectedCount, string.Format(AssertTemplates.AssertObjectsCountTemplate, expectedCount, objectSet.ObjectsCount));
                    assertTrue(objectSet.SizeInBytes > 0, string.Format(AssertTemplates.AssertSizeInBytesTemplate, objectSet.SizeInBytes));
                });
            },
                                                 () => { }
                                                 );
        }
Пример #4
0
        public static void IsNotTestWithFail(Action <bool, string> assertTrue)
        {
            InterfacePropertyTestProgram.Execute(() =>
            {
                dotMemory.Check(memory =>
                {
                    var objectSet = memory.GetObjects(_ => _.Interface.IsNot <InterfacePropertyTestProgram.I1>());

                    assertTrue(objectSet.ObjectsCount == memory.ObjectsCount - InterfacePropertyTestProgram.C12.Count + 1,
                               string.Format(AssertTemplates.AssertObjectsCountTemplate, memory.ObjectsCount - InterfacePropertyTestProgram.C12.Count, objectSet.ObjectsCount));

                    assertTrue(objectSet.SizeInBytes > 0, string.Format(AssertTemplates.AssertSizeInBytesTemplate, objectSet.SizeInBytes));
                });
            },
                                                 () => { }
                                                 );
        }