static void Main(String[] args) { CList <CTest> l = new CList <CTest>(); l.Add(new CTest()); l.Add(new CTest()); l.Add(new CTest()); l.Remove(2); l.Remove(1); var i = l.Add(new CTest()); var v = i.Index; l.AddAt(1, new CTest()); l.AddAt(2, new CTest()); l.AddAt(0, new CTest()); l.Remove(1); var i0 = l.Get(0); var i1 = l.Get(1); if (i1) { Console.WriteLine("i1"); } var i2 = l.Get(2); var i3 = l.Get(3); Console.WriteLine("end"); }
void _LinkFail(TPeerCnt PeerNum_, ENetRet NetRet_) { var itServer = _Servers.Get((Int32)PeerNum_); itServer.Data.NamePort.Clear(); _Servers.Remove(itServer); _LinkFailFunc(PeerNum_, NetRet_); }
public void AddAndRemoveNonReferencingElementsFromCList() { var storage = new InMemoryStorageEngine(); var os = ObjectStore2.New(storage); var cList = new CList <string>(); cList.Add("hello"); cList.Add("world"); cList.Add("from here"); os.Roots.Entangle(cList); os.Persist(); os = ObjectStore2.Load(storage); cList = os.Roots.Find <CList <string> >(); cList.Count.ShouldBe(3); cList[0].ShouldBe("hello"); cList[1].ShouldBe("world"); cList[2].ShouldBe("from here"); cList.Remove(0); os.Persist(); os = ObjectStore2.Load(storage); cList = os.Roots.Find <CList <string> >(); cList.Count.ShouldBe(2); cList[0].ShouldBe("world"); cList[1].ShouldBe("from here"); cList.Remove(1); os.Persist(); os = ObjectStore2.Load(storage); cList = os.Roots.Find <CList <string> >(); cList.Count.ShouldBe(1); cList[0].ShouldBe("world"); cList.Add("hello"); os.Persist(); os = ObjectStore2.Load(storage); cList = os.Roots.Find <CList <string> >(); cList.Count.ShouldBe(2); cList[0].ShouldBe("world"); cList[1].ShouldBe("hello"); cList.Remove(0); cList.Remove(0); os.Persist(); os = ObjectStore2.Load(storage); cList = os.Roots.Find <CList <string> >(); cList.Count.ShouldBe(0); }
public void ElementsAddedAndRemovedToListAreAddedToStateMap() { var l = new CList <int> { 0, 1 }; AttachAndPersist(l); l.Remove(0); l.Remove(0); Persist(); l = Load(); l.Count.ShouldBe(0); }
// public void RemoveValue_Return_Expected_Count_8() { int count = 8; int ExpectedResult = count; //Arrange CList <int> customList = new CList <int>(); int value1 = 10; int value2 = 20; int value3 = 30; int value4 = 40; int value5 = 50; int value6 = 60; int value7 = 70; int value8 = 80; int value9 = 90; //Act customList.Add(value1); customList.Add(value2); customList.Add(value3); customList.Add(value4); customList.Add(value5); customList.Add(value6); customList.Add(value7); customList.Add(value8); customList.Add(value9); customList.Remove(value2); //Assert Assert.AreEqual(ExpectedResult, customList.Count); }
public new void Close(TPeerCnt PeerNum_) { var Peer = _Peers.Get((Int32)PeerNum_); if (Peer) { base.Close(PeerNum_); } else { if (_PeersAndConnectings.Remove((Int32)PeerNum_)) // 여기서 지워야 LockFree 큐에서 들어오는 Connect 정보가 처리되지 않음. { _Connectings.Remove((Int32)PeerNum_); _LinkFail(PeerNum_, ENetRet.UserClose); } } }
bool _Connect(CList <_SServer> .SIterator Server_) { var ConnectNamePort = Server_.Data.PopConnectNamePort(); if (ConnectNamePort) { if (_NetS.Connect(ConnectNamePort, (TPeerCnt)Server_.Index)) { return(true); } } var PeerNum = (TPeerCnt)Server_.Index; _Servers.Remove(Server_); _LinkFailFuncS(PeerNum, ENetRet.ConnectFail); return(false); }
public void InsertAndRemoveBeforePersist() { var l = new CList <int> { 1 }; l.Remove(0); AttachAndPersist(l); Load().Count.ShouldBe(0); }
public void RemoveString_NegativeRemoval_NextString() { //Arrange CList <string> list = new CList <string> { }; string new1String = "New Addition 1"; string new2String = "New Addition 2"; list.Add(new1String); list.Add(new2String); //Act list.Remove(new1String); //Assert Assert.AreNotEqual(list[0], new1String); }
public void RemoveInt_NegativeRemoval_NextInt() { //Arrange CList <int> list = new CList <int> { }; int new1Int = 1; int new2Int = 2; list.Add(new1Int); list.Add(new2Int); //Act list.Remove(new1Int); //Assert Assert.AreNotEqual(list[0], new1Int); }
public void Remove_IndexOF_Add_Methode() { //Arrange CList <int> customList = new CList <int>(); int value = 10; int value1 = 20; //Act customList.Add(value); customList.Add(value1); customList.Remove(value1); //Assert Assert.AreEqual(value, customList[0]); }
public void RemoveFalseStringFrom2_PositiveRemoval_SameString() { //Arrange CList <string> list = new CList <string> { }; string new1String = "New Addition 1"; string new2String = "New Addition 2"; string new3String = "New Addition 3"; list.Add(new1String); list.Add(new2String); //Act list.Remove(new3String); //Assert Assert.AreEqual(list[1], new2String); }
public void RemoveFalseIntFrom2_PositiveRemoval_SameInt() { //Arrange CList <int> list = new CList <int> { }; int new1Int = 1; int new2Int = 2; int new3Int = 3; list.Add(new1Int); list.Add(new2Int); //Act list.Remove(new3Int); //Assert Assert.AreEqual(list[1], new2Int); }
void _LoginClear(TPeerCnt PeerNum_, EGameRet GameRet_) { var itClient = _Clients.Get((Int32)PeerNum_); if (GameRet_ == EGameRet.InvalidID) { itClient.Data.Clear(); } _Clients.Remove(itClient); }
public void RemoveStringFrom3_PositiveRemoval_CorrectCount() { //Arrange CList <string> list = new CList <string> { }; string new1String = "New Addition 1"; string new2String = "New Addition 2"; string new3String = "New Addition 3"; list.Add(new1String); list.Add(new2String); list.Add(new3String); //Act list.Remove(new2String); //Assert Assert.AreEqual(list.Count, 2); }
public void TestByCount_Add_Methode_Return_Expected_Count_1() { //Arrange CList <int> customList = new CList <int>(); int value = 10; int value2 = 20; int CountValue = 1; //Act customList.Add(value); customList.Add(value2); customList.Remove(20); //Assert Assert.AreEqual(CountValue, customList.Count); }
public void Remove_Value_Returen_CountDecreise_ExpectedValue_1_() { //Arrange CList <int> customList = new CList <int>(); int value = 10; int value2 = 20; int Count = 1; int ExpectedResult = Count; //Act customList.Add(value); customList.Add(value2); customList.Remove(value2); //Assert Assert.AreEqual(ExpectedResult, customList.Count); }
public void Capacity_Check_Add_to_List_then_Remove_Index_3_ExpectedReturn_0() { //Arrange CList <int> customList = new CList <int>(); int value1 = 10; int value2 = 20; int ExpectedResult = 0; //Act customList.Add(value1); customList.Add(value2); customList.Remove(value2); //Assert Assert.AreEqual(ExpectedResult, customList[3]); }
// public void RemoveValueIfArrayLenghtIs5_Returen_Expected_CapacityDicrease_Value_4() { //Arrange CList <int> customList = new CList <int>(); // Need Inumerable{ 10, 20, 30, 40 }; int value = 10; int value2 = 20; int Capacity = 4; int ExpectedResult = Capacity; //Act customList.Add(value); customList.Add(value2); customList.Add(value); customList.Add(value); customList.Remove(value2); //Assert Assert.AreEqual(ExpectedResult, customList.Capacity); }
public void RemoveValue_NextValue_expected_GetNewIndex_Value3() { //Arrange CList <int> customList = new CList <int>(); int value1 = 10; int value2 = 20; int value3 = 30; int ExpectedResult = value3; //Act customList.Add(value1); customList.Add(value2); customList.Add(value3); customList.Remove(value2); //Assert Assert.AreEqual(ExpectedResult, customList[1]); }
public void RemoveTestMethod() { //arrange CList <int> storedInts = new CList <int>(); storedInts.Add(1); storedInts.Add(2); storedInts.Add(3); storedInts.Add(4); storedInts.Add(5); //act storedInts.Remove(); //assert Assert.AreEqual(2, storedInts[0]); Assert.AreEqual(3, storedInts[1]); Assert.AreEqual(4, storedInts[2]); Assert.AreEqual(5, storedInts[3]); Assert.AreEqual(0, storedInts[4]); Assert.IsTrue(storedInts.count == 4); }
void _UnLinkCallback(CKey Key_, ENetRet NetRet_) { _PeersAndConnectings.Remove((Int32)Key_.PeerNum); _ConnectTimeOut.Remove((Int32)Key_.PeerNum); _UnLinkFunc(Key_, NetRet_); }
public void Remove(Int32 PeerNum_) { _Connects.Remove(PeerNum_); }