예제 #1
0
        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);
        }
예제 #2
0
        public void Prepend1String()
        {
            var list     = "123";
            var actual   = FList.Prepend('4', list);
            var expected = "4123";

            Assert.AreEqual(expected, actual.ToString());
        }
예제 #3
0
        public void Prepend3()
        {
            var list     = FList.Empty <int>();
            var actual   = FList.Prepend(4, list);
            var expected = FList.New(4);

            Assert.AreEqual(expected, actual);
        }
예제 #4
0
 //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)));
 }
예제 #5
0
 // 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)));
 }