Beispiel #1
0
        public void Remove(InRomNode node)
        {
            if (FirstNodeAddress == null)
            {
                return;
            }
            if (node.Address == FirstNodeAddress)
            {
                FirstNodeAddress = node.NextNodeAdress;
            }
            if (node.Address == LastNodeAddress)
            {
                LastNodeAddress = node.PreviousNodeAddress;
            }

            if (node.NextNodeAdress != null)
            {
                var nextNode = InRomNode.Load(node.NextNodeAdress);
                nextNode.RemovePrevious();
                return;
            }
            if (node.PreviousNodeAddress != null)
            {
                var previousNode = InRomNode.Load(node.PreviousNodeAddress);
                previousNode.RemoveNext();
                return;
            }
        }
Beispiel #2
0
        public InRomNode LastNode()
        {
            if (LastNodeAddress == null)
            {
                return(null);
            }

            return(InRomNode.Load(LastNodeAddress));
        }
        public void Load_ShouldReturnCorrectly()
        {
            var nodeExpected = CreateNodeTest();

            Console.WriteLine(File.ReadAllText(nodeExpected.Address));

            var nodeActual = InRomNode <TestClass> .Load(nodeExpected.Address);

            Assert.IsTrue(nodeActual == nodeExpected);
        }