Example #1
0
            public void ThrowsWhenInsertingDuplicateNamedModule()
            {
                // Given
                CountModule count  = new CountModule("A");
                CountModule count2 = new CountModule("B");
                ModuleList  list   = new ModuleList(
                    new NamedModule("A", count),
                    new NamedModule("B", count2));

                // When, Then
                Assert.That(() => list.Insert(1, new NamedModule("A", count2)), Throws.Exception);
            }
Example #2
0
            public void InsertsModule()
            {
                // Given
                CountModule count  = new CountModule("A");
                CountModule count2 = new CountModule("B");
                ModuleList  list   = new ModuleList(count2);

                // When
                list.Insert(0, count);

                // Then
                Assert.That(list, Is.EqualTo(new [] { count, count2 }));
            }