public void Can_Generate_Class_With_A_Many_Association() { var types = new List<Type> { typeof(Eagle), typeof(Claw), typeof(Wing) }; var yuml = new YumlGenerator(types).Yuml(); Console.WriteLine(yuml); Assert.AreEqual("http://yuml.me/diagram/scruffy/class/[Eagle],[Eagle]->[Claw],[Eagle]1-0..*[Wing],[Claw],[Wing]", yuml); }
static void Main(string[] args) { string yuml; //var foo = typeof(IRoundShape).GetInterfaces(); //new ToYuml.Test.YumlGeneratorTests().Interface_Inheritance_Chaining(); Console.WriteLine("Requesting ab..."); YumlRequest.Request("[A]->[B]", true, "a_b.png"); Console.WriteLine("Requesting abc..."); YumlRequest.Request("[A]->[B],[A]^-[C]", false, "abc.png"); // Oroborous Console.WriteLine("Requesting ToYuml..."); var gen = new YumlGenerator() .AddTypesForAssembly(typeof(YumlRequest)) .SearchNonPublicMembers(true) .UseInterfaceInheritance(true); yuml = gen.Yuml(); YumlRequest.Request(yuml, true, "ToYuml.png"); Console.WriteLine("Requesting ToYuml.Test..."); gen = new YumlGenerator() .AddTypesForAssembly(typeof(Animal)) .UseInterfaceInheritance(true) .SearchNonPublicMembers(true); yuml = gen.Yuml(); YumlRequest.Request(yuml, true, "ToYuml.Test.png"); Console.WriteLine("Done!"); }
public void Random() { var types = new List<Type>(); types.AddRange(new AssemblyFilter(typeof(Folder).Assembly).Types); var yuml = new YumlGenerator(new AssemblyFilter(typeof(NHibernate.TransientObjectException).Assembly).Types.Where(t => t.Namespace.Contains("Cache")).ToList()).Yuml(); Console.WriteLine(yuml); }
public void Bidirectional_A_TO_B_With_Extraneous_Declaration() { // this is better than Current_A_TO_B, but [B] and [A] don't // need to appear here var types = new List<Type> { typeof(A), typeof(B) }; var yuml = new YumlGenerator(types).Yuml(); Check("[A]<->[B],[B],[A]", yuml); }
public void Does_Not_Duplicate_Base_Classes() { var types = new List <Type> { typeof(Animal), typeof(Bird), typeof(Eagle), typeof(Swallow) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Animal],[Bird],[Animal]^-[Bird],[Eagle],[Bird]^-[Eagle],[Swallow],[Bird]^-[Swallow]", yuml); }
public void Duplicate_Types_Appear_Only_Once() { var types = new List <Type> { typeof(Animal), typeof(Animal) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Animal]", yuml); }
public void Field_Is_Interface() { var types = new List <Type> { typeof(Key), typeof(IShiny) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Key],[Key]->[<<IShiny>>]", yuml); }
public void Enumerable_Field_Is_Interface() { var types = new List <Type> { typeof(Key), typeof(INotch) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Key],[Key]-0..*>[<<INotch>>]", yuml); }
public void Base_Class_Dependencies_Do_Not_Show_In_Derived_Class() { var types = new List<Type> { typeof(Mass), typeof(Rock), typeof(Igneous) }; var yuml = new YumlGenerator(types).Yuml(); // This is odd, because Rock has a property Mass, a field Mass, and a List<Mass>. The process // outputs the enumerable first, followed by the single field (since we're not counting actual // references here yet) Check("[Mass],[Rock],[Rock]-0..*>[Mass],[Igneous],[Rock]^-[Igneous]", yuml); }
public void Current_A_TO_B() { var types = new List <Type> { typeof(A), typeof(B) }; var yuml = new YumlGenerator(types).Yuml(); Check("[A]->[B],[B]->[A],[A],[B]", yuml); }
public void Ideal_Bidirectional_A_TO_B() { var types = new List <Type> { typeof(A), typeof(B) }; var yuml = new YumlGenerator(types).Yuml(); Check("[A]<->[B]", yuml); }
public void Bidirectional_One_To_One_Shows_Double_Ended_Arrow() { var types = new List <Type> { typeof(Container), typeof(Component) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Container]<->[Component]", yuml); }
public void Can_Generate_Class_With_A_Many_Association() { var types = new List <Type> { typeof(Eagle), typeof(Claw), typeof(Wing) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Eagle],[Eagle]-0..*>[Wing],[Eagle]->[Claw],[Claw],[Wing]", yuml); }
public void Random() { var types = new List <Type>(); types.AddRange(new AssemblyFilter(typeof(Folder).Assembly).Types); var yuml = new YumlGenerator(new AssemblyFilter(typeof(NHibernate.TransientObjectException).Assembly).Types.Where(t => t.Namespace.Contains("Cache")).ToList()).Yuml(); Console.WriteLine(yuml); }
public void Can_Generate_Class_With_A_Many_Association() { var types = new List <Type> { typeof(Eagle), typeof(Claw), typeof(Wing) }; var yuml = new YumlGenerator(types).Yuml(); Console.WriteLine(yuml); Assert.AreEqual("http://yuml.me/diagram/scruffy/class/[Eagle],[Eagle]->[Claw],[Eagle]1-0..*[Wing],[Claw],[Wing]", yuml); }
public void Interface_Inheritance_TRUE() { // second way is explicit var types = new List <Type> { typeof(IAnimalPrey), typeof(Swallow) }; var yuml = new YumlGenerator(types).UseInterfaceInheritance(true).Yuml(); Check("[<<IAnimalPrey>>],[Swallow],[<<IAnimalPrey>>]^-.-[Swallow]", yuml); }
public void Interfaces_Are_Referenced_From_Declaring_Class() { var types = new[] { typeof(IShape), typeof(Rhombus), typeof(Square) }; var yuml = new YumlGenerator(types) .UseInterfaceInheritance(true) .SearchNonPublicMembers(true) .Yuml(); Check("[<<IShape>>],[Rhombus],[Square],[<<IShape>>]^-.-[Rhombus],[Rhombus]^-[Square]", yuml); }
public void Bidirectional_A_TO_B_With_Extraneous_Declaration() { // this is better than Current_A_TO_B, but [B] and [A] don't // need to appear here var types = new List <Type> { typeof(A), typeof(B) }; var yuml = new YumlGenerator(types).Yuml(); Check("[A]<->[B],[B],[A]", yuml); }
public void Interface_Inheritance_FALSE() { var types = new List <Type> { typeof(Swallow), typeof(IAnimalPrey) }; // first way is inline var yuml = new YumlGenerator(types).UseInterfaceInheritance(false).Yuml(); Check("[<<IAnimalPrey>>;Swallow]", yuml); }
public void Interface_Inheritance_Chaining() { var types = new[] { typeof(IShape), typeof(IRoundShape), typeof(Ellipse) }; var yuml = new YumlGenerator(types) .UseInterfaceInheritance(true) .SearchNonPublicMembers(true) .Yuml(); Check("[<<IShape>>],[<<IRoundShape>>],[Ellipse],[<<IShape>>]^-.-[<<IRoundShape>>],[<<IRoundShape>>]^-.-[Ellipse]", yuml); }
public void Public_And_Private_Fields() { var types = new List <Type> { typeof(Lock), typeof(Key), typeof(Secret) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Lock],[Lock]->[Key],[Key],[Secret]", yuml); yuml = new YumlGenerator(types).SearchNonPublicMembers(true).Yuml(); Check("[Lock],[Lock]->[Key],[Lock]->[Secret],[Key],[Secret]", yuml); }
public void Base_Class_Dependencies_Do_Not_Show_In_Derived_Class() { var types = new List <Type> { typeof(Mass), typeof(Rock), typeof(Igneous) }; var yuml = new YumlGenerator(types).Yuml(); // This is odd, because Rock has a property Mass, a field Mass, and a List<Mass>. The process // outputs the enumerable first, followed by the single field (since we're not counting actual // references here yet) Check("[Mass],[Rock],[Rock]-0..*>[Mass],[Igneous],[Rock]^-[Igneous]", yuml); }
public void Interface_Inheritance_TRUE() { // second way is explicit var types = new List<Type> { typeof(IAnimalPrey), typeof(Swallow) }; var yuml = new YumlGenerator(types).UseInterfaceInheritance(true).Yuml(); Check("[<<IAnimalPrey>>],[Swallow],[<<IAnimalPrey>>]^-.-[Swallow]", yuml); }
public void Can_Generate_Class_With_A_Many_Association() { var types = new List<Type> { typeof(Eagle), typeof(Claw), typeof(Wing) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Eagle],[Eagle]-0..*>[Wing],[Eagle]->[Claw],[Claw],[Wing]", yuml); }
public void Ideal_Bidirectional_A_TO_B() { var types = new List<Type> { typeof(A), typeof(B) }; var yuml = new YumlGenerator(types).Yuml(); Check("[A]<->[B]", yuml); }
public void Enumerable_Field_Is_Interface() { var types = new List<Type> { typeof(Key), typeof(INotch) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Key],[Key]-0..*>[<<INotch>>]", yuml); }
public void Interface_Inheritance_FALSE() { var types = new List<Type> { typeof(Swallow), typeof(IAnimalPrey) }; // first way is inline var yuml = new YumlGenerator(types).UseInterfaceInheritance(false).Yuml(); Check("[<<IAnimalPrey>>;Swallow]", yuml); }
public void Does_Not_Duplicate_Base_Classes() { var types = new List<Type> { typeof(Animal), typeof(Bird), typeof(Eagle), typeof(Swallow) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Animal],[Bird],[Animal]^-[Bird],[Eagle],[Bird]^-[Eagle],[Swallow],[Bird]^-[Swallow]", yuml); }
public void Field_Is_Interface() { var types = new List<Type> { typeof(Key), typeof(IShiny) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Key],[Key]->[<<IShiny>>]", yuml); }
public void Bidirectional_One_To_One_Shows_Double_Ended_Arrow() { var types = new List<Type> { typeof(Container), typeof(Component) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Container]<->[Component]", yuml); }
public void Public_And_Private_Fields() { var types = new List<Type> { typeof(Lock), typeof(Key), typeof(Secret) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Lock],[Lock]->[Key],[Key],[Secret]", yuml); yuml = new YumlGenerator(types).SearchNonPublicMembers(true).Yuml(); Check("[Lock],[Lock]->[Key],[Lock]->[Secret],[Key],[Secret]", yuml); }
public void Duplicate_Types_Appear_Only_Once() { var types = new List<Type> { typeof(Animal), typeof(Animal) }; var yuml = new YumlGenerator(types).Yuml(); Check("[Animal]", yuml); }
public void Current_A_TO_B() { var types = new List<Type> { typeof(A), typeof(B) }; var yuml = new YumlGenerator(types).Yuml(); Check("[A]->[B],[B]->[A],[A],[B]", yuml); }