Beispiel #1
0
        public void CreateAndAddEntryFromGenInfo_DefaultGenInfo_SuccessfullyAdded()
        {
            GeneratorMappingManager genMgr        = Factory_GeneratorMappingManager_Default();
            GenEntryConfigInfo      genConfigInfo = Factory_GenEntryConfigInfo_Default();

            genMgr.CreateAndAddEntryFromGenInfo(genConfigInfo);

            Assert.AreEqual(1, genMgr.GetNumEntries());
        }
Beispiel #2
0
        public void AddGenMappingEntry_SingleEntry_SuccessfullyAdded()
        {
            GeneratorMappingManager       genMgr       = Factory_GeneratorMappingManager_Default();
            Mock <IGeneratorMappingEntry> genEntryMock = MockFactory_IGeneratorMappingEntry();

            int newId = genMgr.AddMappingEntry(genEntryMock.Object);

            Assert.AreEqual(1, genMgr.GetNumEntries());
            Assert.AreEqual(genEntryMock.Object.Id, genMgr.GetCopyOfMappingEntryById(newId).Value.Id);
            Assert_GenEntryIsInitialized(genEntryMock.Object);
        }
Beispiel #3
0
        public void RemoveGenMappingEntry_RemoveSecondEntry_SuccessfullyRemoved()
        {
            GeneratorMappingManager       genMgr        = Factory_GeneratorMappingManager_Default();
            Mock <IGeneratorMappingEntry> genEntryMock1 = MockFactory_IGeneratorMappingEntry();
            Mock <IGeneratorMappingEntry> genEntryMock2 = MockFactory_IGeneratorMappingEntry();
            Mock <IGeneratorMappingEntry> genEntryMock3 = MockFactory_IGeneratorMappingEntry();

            int id1 = genMgr.AddMappingEntry(genEntryMock1.Object);
            int id2 = genMgr.AddMappingEntry(genEntryMock2.Object);
            int id3 = genMgr.AddMappingEntry(genEntryMock3.Object);

            genMgr.RemoveMappingEntry(id2);

            Assert.AreEqual(2, genMgr.GetNumEntries());
            Assert.AreEqual(genEntryMock1.Object.Id, genMgr.GetCopyOfMappingEntryById(id1).Value.Id);
            Assert.AreEqual(genEntryMock3.Object.Id, genMgr.GetCopyOfMappingEntryById(id3).Value.Id);
        }
Beispiel #4
0
        public void Constructor_DefaultConstructor_DoesntContainAnyEntries()
        {
            GeneratorMappingManager genMgr = Factory_GeneratorMappingManager_Default();

            Assert.AreEqual(0, genMgr.GetNumEntries());
        }