How do you unit test an algorithm in C#? -


i've ran situation i'm not sure how test: algorithms. specifically, i'm attempting write adler32 method , create unit test it, hit brick wall @ point.

my first attempt ended being shortened version of same code had in method, seems wrong do. next attempt have table of input values expected results, compare expected results actual results... seemed idea until realized way know how populate table running algorithm. i'm pretty stuck. how 1 go unit testing algorithm without reusing algorithm in unit tests (directly or indirectly)?

use table of inputs , known outputs described. need outputs implementation of same algorithm source know accurate.

if you're implementing algorithm doesn't have readily available input/output data, re-implement algorithm way, such in excel, , generate data know accurate. statistical calculations reports can generate data in excel.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -