c# - When out of index of fixed array how to pragmatically restart at beginning -
Prerequisites:
Return the total count of files (records) for the date. Assign a modifier (single character A-Z 0- 9) to represent the count.
INFORMATION: With this date / time this modifier will be used to locate the file through the system.
Current solution:
[test] Public Zero FileIDModifierShouldReturn9 () {var filecountfordate = 35; Var '', 'H', 'I', 'J', 'K', 'R', 'A', 'B', 'C', 'D', 'E', 'F', 'J ',' H ',' L ',' M ',' N ',' O ',' P ',' Q ',' R ',' S ',' T ',' U ',' V ' 'W', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8' '9'}; Expected by Var = "9"; Var actual = thresher [filecountfordate]. Ostring (); Extraordinary (Expected, real); }
Problem: When the file count is greater than the index of the array, then an exception is obviously thrown.
The second test:
[test] Public Zero when fileIndexEditifierbuggersTanarerhealthStartOut and returnValue () {var filecountfordate = 71; Var '', 'H', 'I', 'J', 'K', 'R', 'A', 'B', 'C', 'D', 'E', 'F', 'J ',' H ',' L ',' M ',' N ',' O ',' P ',' Q ',' R ',' S ',' T ',' U ',' V ' 'W', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8' '9'}; If (filecountfordate> 35) {filecountfordate = filecountfordate% 36; } Var = "9" expected; Var actual = thresher [filecountfordate]. Ostring (); Extraordinary (Expected, real); }
My problem is that I need to be able to restart the array at the beginning, along with endless "if" statements. It's late and my brain is dead and so can not come with proper solution.
Any help is appreciated.
Without any losses, you can use more than 36 file count modules
Comments
Post a Comment