This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
///Within のテスト | |
///</summary> | |
public void WithinTest2Helper<T>(StructInterval<T> target, T obj, bool expected) where T : struct, IComparable<T> { | |
bool actual = target.Within(obj); | |
Assert.AreEqual(expected, actual); | |
} | |
[TestMethod()] | |
public void WithinTest2() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class testClass : RecursionBase<testClass> { | |
public testClass() { | |
this.Name = "oya"; | |
//Addしてみる | |
this.Children.Add(new testClass() { Name = "ko1" }); | |
this.Children[0].Children.Add(new testClass() { Name = "mago1" }); | |
//AddRangeしてみる | |
var children = new RecursionCollection(this); | |
children.Add(new testClass() { Name = "ko2" }); | |
children.Add(new testClass() { Name = "ko3" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 抽象再帰クラス | |
/// </summary> | |
public abstract class RecursionBase<T> where T : RecursionBase<T> { | |
#region コンストラクタ | |
protected RecursionBase() { | |
Children = new RecursionCollection(this); | |
} |
NewerOlder