public void DefaultTypeIsString() { SharkPath path = new SharkPath("/path/{var}/otherpath"); Dictionary <string, Type> variables = path.GetVariableTypes(); Assert.True(variables.ContainsKey("var")); Assert.Equal(variables["var"], typeof(string)); }
public void EverySupportedType() { SharkPath path = new SharkPath("/{vs:string}/{vc:char}/{vb:bool}/{vby:byte}/{vsh:short}/{vi:int}/{vl:long}/{vf:float}/{vd:double}/{vus:ushort}/{vui:uint}/{vul:ulong}"); Dictionary <string, Type> variables = path.GetVariableTypes(); Assert.True(variables.ContainsKey("vs")); Assert.Equal(variables["vs"], typeof(string)); Assert.True(variables.ContainsKey("vc")); Assert.Equal(variables["vc"], typeof(char)); Assert.True(variables.ContainsKey("vb")); Assert.Equal(variables["vb"], typeof(bool)); Assert.True(variables.ContainsKey("vby")); Assert.Equal(variables["vby"], typeof(byte)); Assert.True(variables.ContainsKey("vsh")); Assert.Equal(variables["vsh"], typeof(short)); Assert.True(variables.ContainsKey("vi")); Assert.Equal(variables["vi"], typeof(int)); Assert.True(variables.ContainsKey("vl")); Assert.Equal(variables["vl"], typeof(long)); Assert.True(variables.ContainsKey("vf")); Assert.Equal(variables["vf"], typeof(float)); Assert.True(variables.ContainsKey("vd")); Assert.Equal(variables["vd"], typeof(double)); Assert.True(variables.ContainsKey("vus")); Assert.Equal(variables["vus"], typeof(ushort)); Assert.True(variables.ContainsKey("vui")); Assert.Equal(variables["vui"], typeof(uint)); Assert.True(variables.ContainsKey("vul")); Assert.Equal(variables["vul"], typeof(ulong)); }