public void Prepend1() { var list = FList.New(1, 2, 3); var actual = FList.Prepend(4, list); var expected = FList.New(4, 1, 2, 3); Assert.AreEqual(expected, actual); }
public void Prepend1String() { var list = "123"; var actual = FList.Prepend('4', list); var expected = "4123"; Assert.AreEqual(expected, actual.ToString()); }
public void Prepend3() { var list = FList.Empty <int>(); var actual = FList.Prepend(4, list); var expected = FList.New(4); Assert.AreEqual(expected, actual); }
//Pure public static FList <Neutron> CreateNeutronList(int NeutronNumber, FList <Neutron> NeutronNumberList) { return(NeutronNumber == FList.Length(NeutronNumberList) ? NeutronNumberList : CreateNeutronList(NeutronNumber, FList.Prepend(new Neutron(0), NeutronNumberList))); }
// genral case, edge case //Pure public static FList <Proton> CreateProtonList(int AtomicNumber, FList <Proton> AtomicNumberList) { return(AtomicNumber == FList.Length(AtomicNumberList) ? AtomicNumberList : CreateProtonList(AtomicNumber, FList.Prepend(new Proton(0), AtomicNumberList))); }