| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.Linq; |
| | | 4 | | |
| | | 5 | | namespace Test |
| | | 6 | | { |
| | | 7 | | class TestClass2 |
| | | 8 | | { |
| | | 9 | | private string name; |
| | | 10 | | |
| | 2 | 11 | | private Dictionary<string, int> dict = new Dictionary<string, int>(); |
| | | 12 | | |
| | 3 | 13 | | public string ExecutedProperty { get; set; } |
| | | 14 | | |
| | 0 | 15 | | public string UnExecutedProperty { get; set; } |
| | | 16 | | |
| | 0 | 17 | | public TestClass2() |
| | 0 | 18 | | { |
| | 0 | 19 | | this.name = "Nobody"; |
| | 0 | 20 | | this.ExecutedProperty = "Nobody"; |
| | 0 | 21 | | } |
| | | 22 | | |
| | 2 | 23 | | public TestClass2(string name) |
| | 2 | 24 | | { |
| | 2 | 25 | | this.name = name; |
| | 2 | 26 | | this.ExecutedProperty = name + name; |
| | 2 | 27 | | } |
| | | 28 | | |
| | | 29 | | public void ExecutedMethod() |
| | 1 | 30 | | { |
| | 1 | 31 | | Console.WriteLine(this.name); |
| | 1 | 32 | | Console.WriteLine(this.ExecutedProperty); |
| | 1 | 33 | | } |
| | | 34 | | |
| | | 35 | | public void UnExecutedMethod() |
| | 0 | 36 | | { |
| | 0 | 37 | | Console.WriteLine(this.name); |
| | 0 | 38 | | Console.WriteLine(this.ExecutedProperty); |
| | 0 | 39 | | } |
| | | 40 | | |
| | | 41 | | public void SampleFunction(string city) |
| | 1 | 42 | | { |
| | 1 | 43 | | int[] values = new int[] { 0, 1, 2, 3 }; |
| | | 44 | | |
| | 5 | 45 | | var doubled = values.Select(i => i * 2); |
| | | 46 | | |
| | 11 | 47 | | foreach (var item in doubled) |
| | 4 | 48 | | { |
| | 4 | 49 | | Console.WriteLine(item); |
| | 4 | 50 | | } |
| | | 51 | | |
| | 1 | 52 | | string[] cities = new string[] { "Berlin", "Munich", "Paris" }; |
| | | 53 | | |
| | 4 | 54 | | if (cities.SingleOrDefault(c => c.Equals(city, StringComparison.OrdinalIgnoreCase)) != null) |
| | 1 | 55 | | { |
| | 1 | 56 | | Console.WriteLine("Found " + city); |
| | 1 | 57 | | } |
| | 1 | 58 | | } |
| | | 59 | | |
| | | 60 | | public string DoSomething(string value, |
| | | 61 | | string[] stringArray, |
| | | 62 | | Guid id, |
| | | 63 | | IEnumerable<string> stringEnumerable, |
| | | 64 | | IList<string> stringList, |
| | | 65 | | decimal dec, |
| | | 66 | | int i, |
| | | 67 | | Dictionary<string, int> dict, |
| | | 68 | | out int g, |
| | | 69 | | float fff, |
| | | 70 | | double dou, |
| | | 71 | | bool bo, |
| | | 72 | | byte by, |
| | | 73 | | char ch, |
| | | 74 | | object o, |
| | | 75 | | sbyte sby, |
| | | 76 | | short sh, |
| | | 77 | | uint ui, |
| | | 78 | | ulong ul, |
| | | 79 | | ushort usho) |
| | 0 | 80 | | { |
| | 0 | 81 | | g = 0; |
| | 0 | 82 | | return null; |
| | 0 | 83 | | } |
| | | 84 | | } |
| | | 85 | | } |