static void Main(string[] args) { bool change = false; double aNext; string output = ""; ListOne <double> list = new ListOne <double>(); ListOne <double> listNoChange = new ListOne <double>(); Console.WriteLine($"Введите n"); int n = InputInt(); Console.WriteLine($"Введите a1"); double a = InputNum(); list.AddReverse(a); listNoChange.Add(a); output += a + "\n"; if (n == 1) { Console.WriteLine("Последовательность:"); Console.WriteLine(a); } else { for (int i = 2; i <= n; i++) { Console.WriteLine($"Введите a{i}"); aNext = InputNum(); if (aNext < a) { change = true; } a = aNext; list.AddReverse(a); if (!change) { listNoChange.Add(a); } } Console.WriteLine("Последовательность:"); if (change) { list.ShowList(); } else { listNoChange.ShowList(); } } }
public void TestMethodListAdd1() { //Arrange ListOne <double> l = new ListOne <double>(); //Act l.Add(1, l.MakePoint(1)); //Assert Assert.IsTrue(l.Length == 1); }
public void TestMethodListAdd4() { //Arrange double[] arr = new double[] { 0.2, 0.4 }; ListOne <double> l = new ListOne <double>(arr); //Act l.Add(2, arr); //Assert Assert.IsTrue(l.Length == 4); }
public void TestMethodListAdd2() { //Arrange double[] arr = new double[] { 0.2, 0.4 }; ListOne <double> l = new ListOne <double>(arr); //Act l.Add(2, l.MakePoint(1)); //Assert Assert.IsTrue(l.Length == 3); }
public DragAndDropVm() { ListOne.Add(new DragableData { Name = "Steve" }); ListOne.Add(new DragableData { Name = "Fred" }); ListOne.Add(new DragableData { Name = "Sally" }); ListOne.Add(new DragableData { Name = "Hank" }); ListOne.Add(new DragableData { Name = "Jane" }); ListTwo.Add(new DragableData { Name = "Zach" }); }
private void MoveFromListTwoToListOneAsync(DragableData item) { ListTwo.Remove(item); ListOne.Add(item); }