Ejemplo n.º 1
0
        public void should_call_specific_method_by_method_name()
        {
            var mock = new Mock<AnyClass>();
            mock.Setup(o => o.AnyMethod());

            var objectArray = new[] {mock.Object};
            objectArray.Each("AnyMethod".a<AnyClass>());

            mock.VerifyAll();
        }
Ejemplo n.º 2
0
 public void should_sum_numbers_by_Inject()
 {
     var expected = new[] {1, 2, 3}.Inject(0, (s, v) => s += v);
     Assert.AreEqual(6, expected);
 }
Ejemplo n.º 3
0
 public void should_join_strings()
 {
     var expected = new[] {"a", "b", "c"}.Join();
     Assert.AreEqual("abc", expected);
 }
Ejemplo n.º 4
0
 public void should_join_numbers()
 {
     var expected = new[] { 1, 2, 3 }.Join();
     Assert.AreEqual("123", expected);
 }
Ejemplo n.º 5
0
 public void should_add_1_for_each_number_in_array()
 {
     var expected = new []{1, 2, 3}.Map(o => o + 1);
     Assert.AreEqual(new []{2, 3, 4}, expected);
 }
Ejemplo n.º 6
0
 public void should_convert_strings_in_array_to_upper_case()
 {
     var expected = new []{"a", "b", "c"}.Map("ToUpper".f<string>());
     Assert.AreEqual(new []{"A", "B", "C"}, expected);
 }