public void CreateSetParamsGetNameParams() { const string format = "{intInc_G}/{intInc_D}/02-{yy}"; const string typeName = "Orders"; var initParams = new List<KeyValuePair<int, string>> { new KeyValuePair<int, string>(0, "2296"), new KeyValuePair<int, string>(1, "1") }; var orderNamingApproach = new NamingApproach { Format = format, TypeName = typeName }; orderNamingApproach.SaveCurrentParams(initParams); var newName = orderNamingApproach.GetNextName(); Assert.AreEqual("2297/2/02-12", newName); }
public void CreateGetParamBlocks() { const string format = "{intInc_G}/{intInc_D}/02-{yy}"; const string typeName = "Orders"; var initParams = new List<KeyValuePair<int, string>> { new KeyValuePair<int, string>(0, "2296"), new KeyValuePair<int, string>(1, "1") }; var orderNamingApproach = new NamingApproach { Format = format, TypeName = typeName }; orderNamingApproach.SaveCurrentParams(initParams); var breakdown = orderNamingApproach.ParamBlocks; Assert.AreEqual("1", breakdown[2]); }
public void CreateSetParamsWriteOutParams() { const string format = "{intInc_G}/{intInc_D}/02/-{yy}"; const string typeName = "Orders"; var initParams = new List<KeyValuePair<int, string>> {new KeyValuePair<int, string>(0, "2296"), new KeyValuePair<int, string>(1, "1")}; var orderNamingApproach = new NamingApproach {Format = format, TypeName = typeName}; orderNamingApproach.SaveCurrentParams(initParams); Console.WriteLine(orderNamingApproach.CurrentParamsCounters); Assert.IsNotEmpty(orderNamingApproach.CurrentParamsCounters); }