public void Invalid_level_throws_ArgumentException(string input) { Assert.Throws<ArgumentException>(() => { var value = new FetchPlan(input); }); }
public void GuardClause() { Assert.Throws<ArgumentNullException>(() => { var value = new FetchPlan(null); }); }
public void Duplicated_depth_throws_ArgumentException(string input) { Assert.Throws<ArgumentException>(() => { var value = new FetchPlan(input); }); }
public void Complex_fetch_plan() { var value = new FetchPlan("[3-5]in_*:-2 out_*:-1 myValue:1"); Assert.Equal(3, value.Levels.From); Assert.Equal(5, value.Levels.To); Assert.Equal(3, value.DepthMapping.Count); Assert.Equal(DepthLevel.LevelType.Excluded, value.DepthMapping["in_*"].Level); Assert.Equal(DepthLevel.LevelType.Unlimited, value.DepthMapping["out_*"].Level); Assert.Equal(DepthLevel.LevelType.Level, value.DepthMapping["myValue"].Level); Assert.Equal(1, value.DepthMapping["myValue"].Value); }
public void New_one_is_default() { var value = new FetchPlan(); Assert.True(value.IsDefault); }
public void New_one_is_all_first_level() { var value = new FetchPlan(); Assert.True(value.Levels.IsAll); Assert.True(value.DepthMapping["*"].Value == 1); }
public void Initialize_with_valid_fetch_plan_string(string input) { var value = new FetchPlan(input); Assert.NotNull(value); }
public void Valid_fetch_plan_string_ToString(string input, string expected) { var value = new FetchPlan(input); Assert.Equal(expected, value.ToString()); }