示例#1
0
        public void DuckDuckGooseTests(int goose, string expectedName)
        {
            var    exampleNames = new string[] { "a", "b", "c", "d", "c", "e", "f", "g", "h", "z" };
            var    players      = exampleNames.Select(x => new Player(x)).ToArray();
            string sut          = DuckDuckGoose.PlayDuckDuckGoose(players, goose);

            NUnit.Framework.Assert.AreEqual(sut, expectedName);
        }
示例#2
0
        public void DuckDuckGooseRandomTests()
        {
            Random random = new Random();

            string[] names = { "troubledruddy", "neuromarake", "pausefork", "eleazarstudies", "thighsubscript", "bulldarkened", "harmonicsupport", "peduncleinventory", "layingbinnacle", "chinaboots", "nappiesfunding", "pesounwieldy", "sproutpolicies", "mineradopt", "chinnockstaking", "bulginggrubby", "slugdebonair", "signtrouble", "spot!virgo", "carriagestaffnet", "hoursant", "pruneawe", "carrotssecretariat", "fundscocoa", "josiehung", "flavourederror", "decisivecrater", "filmsbeijing", "milderholy", "axelinitial", "pheasantecozone", "hashwhisper", "cronzgrotesque", "jerkycodswallop", "chadgin", "greetbling", "teachingmatch", "piedopossum", "cannonburgee", "questbaloo", "propertycompound", "obeisancequote", "junglegamepad", "ornatesleepover", "maternalsatellite", "pizzaactin", "jacktobermory", "vaguebelle", "taigaexcellent", "citiesdrolsay", "wavetrolly", "outspokengoshawk", "uggersvenogram", "currishwe", "offensivedunny", "binnaclebubba", "selfieampere", "tousledjournal", "tourrydberg", "collarbonekiss", "spewottawa", "causedsled", "gatorpotion", "hurriedgrazed", "visitsbustard", "rustynotes", "harthashtag", "pepsiescabeche", "postmangrowl", "journalistbobbin", "vansoundcloud", "glyderaustanley", "hocksines", "hashtaggitano", "modelegacy", "hawkinghumanist", "parsecopen", "alterdomain", "xpathapplies", "beneathextinction", "selectivepedestrian", "submitnibbles", "whitepicking", "smartiescrowhop", "jetstinchar", "cameratry", "studiesoften", "aspenleaking", "napkintennessee", "chavpot", "noddingprolapse", "elmoroxie", "cratonthatched", "collegesam", "dykeiceland", "bitscougar", "herbentertain", "namelondon", "skyebusiness", "volumetricharry", "flapswain", "googlehosts", "warningbefriend", "picklechoose", "meigskark", "uraniumweasel", "londonderrygaia", "strutsandstone", "cramercastration", "exaltedunpopular", "hickorygolfer", "diggingracial", "deliciouscecil", "bodycoals", "discusmeticulous", "wheelchairdishes", "pabloapples", "nosedfreedom", "prolapsestark", "denbyneat", "trojanflawed", "feistyfyne", "teasezenyatta", "syllablesworthwhile", "outragedinfuriated", "sybaseois\u00EDn", "gwendraethcraton", "macaroontoll", "newleaking", "ecozonetlikakila", "quallingsebastian", "hawserforehead", "historicalcannon", "regretfossil", "variablegray", "pastelruby", "taunteffluvium", "statuesnike", "yankieshrawley", "jasminebudweiser", "barbequedbilliards", "managerspretty", "heatinghermit", "ribotcuban", "cartridgesherd", "cheesynorton", "carotidsickness", "cramponsmutton", "usableupdated", "gamesyeasty", "fissionpeduncle", "mouldyequalizer", "kingstonsmirk", "copysing", "budshanger", "bewilderedtilly", "completioncitric", "jollypoo", "fluoridestrengthen", "deleteqed", "rescuebook", "assetcrunchy", "izmirpimento", "picayunecrest", "jazzsteeve", "willflag", "kochipooh", "yearningflushing", "goalimminent", "barracudagucci", "puncturepubic", "publisherpostit", "darlingsub", "ticketparmesan", "dunslandjasper", "topurse", "loanfond", "rudepart", "joyskull", "willinit", "tongueasia", "plateletartificial", "reportrutland", "unseasonedmoldwarp", "ruthlessspeedboat", "georgiastabber", "leafhysterical", "winstonwestfield", "squidnebraska", "wombadimension", "billspecify", "empanadaoncology", "egadcoffle", "meltedarena", "kungsampson", "radblessing", "blesspace", "goillouie", "lockedshallow", "ovenbirdbiscuit", "fibbersphene", "debrisjasper", "hisfrancium", "peachesdo", "weixinmasticate", "predicttorro", "olliedatabase", "fallantimatter", "lucywrestling", "enchantingupright", "horsesmarten", "poolfermented", "limitingdisplay", "tonkdingdong", "portercurb", "stunsute", "copperminelogger", "taipeisleuth", "computerisla", "miramichiunalakleet", "callistoely", "luckyserin", "infantilemen", "radiostoed", "capellaeyed", "grammarianplutonium", "wordsscare", "svelteadopt", "bottlecog", "cakeinitiated", "magnetmoonshadow", "dexterticket", "radianbirk", "charonporcupine", "diligenceearth", "mimosadecipher", "stringmanaged", "injurepeaceful", "circleclutching", "vestawakefield", "pavoscreen", "madisonminiature", "elearningthrush", "glazemailer", "improvechurch", "chiliroche", "fabkame", "notatedcricked", "primesvisible", "havinganalysing", "castingbevvy", "synclinelemur", "hornsponge", "shetlandcobra", "investorsdomino", "scentedsupplier", "volansmalboro", "surdjangle", "adelefarrah", "pulsarfantastic", "sparkletaste", "patepapoose", "dulekits", "breadbewildered", "bivycothi", "blondiebandage", "shinlimbic", "pourvoluntary", "inverianviegailee", "fryerforefoot", "crimdonwillow", "fermiumdeneb", "horsebackflagellum", "sinusginger", "soupypigeon", "websitescracked", "allagashincrease", "streamiced", "toothsometawe", "writerings", "bewitchedsunflower", "royalhorden", "seminoleutensil", "supportersartistic", "hardnessyorkshire", "pridemilly", "zealousalberta", "effectorcow", "sadfarnack", "spicaflats", "pythonfeast", "shysterbipolar", "beepingbraces", "angelstone", "maiseycanadian", "pembrokecarbonate", "sycanaussi", "snowdonbailey", "tentfetus", "auditils", "filletsherman", "mentionoval", "coloradocustard", "twiteacrid", "nanaimofervent", "gastropubbring", "ontariodrizzly", "fruityzaftig", "quicklimereceive", "monktonmeadcaroy", "nemoland", "malakruth", "anyhips", "gurgletags", "patterpanda", "valhronadartmoor", "flutherstrut", "cardiffthorough", "nevercomic", "severalexpression", "cattlearrival", "lacunamortician", "metrudy", "willowrenren", "tutorbaffin", "eyewoozy", "carelessfancy", "passcrush", "closedaffy", "hangeruno", "psammiterolly", "cowboycam", "troglodytecenter", "nonstopderry", "theopine", "noveltystepper", "moreenderman", "spawnedtanka", "spatulashare", "leggingswinter", "lliweddtaiga", "solvastirring", "impartialmustache", "anoraklumber", "yodelgreenish", "platformhoarse", "jugglingheptagon", "resistorfrogs", "begantrash", "dividepluto", "bynursing", "parrottdrunken", "beatlongfellow", "greasyflank", "stomachsudanese", "nappinglimey", "loggercharge", "marmaladecluster", "undaepounding", "americantrumpet", "stakinglukely", "playersapply", "truckdiseases", "heptagonitchy", "sportduisk", "treenaildecimal", "relayworcestershire", "raisinfreckles", "bikeblackjack", "hettytatin", "lippedblush", "vapidbillingham", "chewyfairy", "scribblecommunal", "swingrigid", "indelibleemm", "liquidrowdy", "transomlipped", "wanderthroat", "jerboamendip", "evacuationtactful", "oilyskype", "uslateral", "ammoniabeldon", "winterfavorable", "incubateskewer", "unsuitableensorcell", "dislikehypergalaxy", "cheerroyal", "favorpopinjay", "navigationvacuous", "reactivesummerside", "journalscurrency", "grotesquepentland", "menorahdoodilmore", "laireatable", "aspendauphine", "trenchheard", "husbandfinalist", "dustyformulas", "daisybroderick", "wallybobble", "spittalmoney", "appaloosacurved", "displayedtrenton", "goliathfollow", "wackmahjong", "archivesship", "clippingcockroach", "copapplejack", "cascadedundo", "tentpouch", "meticuloustarbert", "eventprocess", "littleporsche", "quietfinancials", "poomoist", "turtledoveacrobat", "maggothomesick", "chevingtonbleach", "nominationclose", "tahoregina", "norfolkchicken", "brockeyebuttercream", "idefechlin", "systemjiggle", "hammondhoop", "shingleskraft", "directoryjocular", "colorlesschromate", "studiedsinful", "soothekappa", "compoundscarp", "babingleyreduce", "limpingwizzed", "deceivesteering", "staithesmullion", "bellslips", "riddlestarchy", "burningstaithes", "pilototis", "advisorbank", "magnesiumeland", "milansociety", "malakgordon", "usanarrow", "hillsfeisty", "fonticonscotta", "dykemontie", "payingvenerated", "glissadecomplex", "shrewdnesscheese", "climbingegret", "scuppersimplicity", "jaialaiuppity", "softwarefindhorn", "directmashed", "statemusic", "bustprotostar", "campbelltonrealize", "eskimopipe", "croasdalenice", "archerymods", "tradeverde", "whateverhinnisdal", "socialvitamin", "laboredspoiled", "placesure", "lawersbrady", "fadejibboom", "stringvanderbilt", "spewweibo", "grassleesmasons", "fixcornea", "intestineabject", "sensorzodiacal", "triangularobliquity", "chestherschel", "granolamonsoon", "visualcheerful", "millieeared", "scriptswhoreson", "weddingwealth", "lucyicon", "prolapseapple", "ptarmiganindianapolis", "cheatonruby", "watermeloncroasdale", "templaterace", "crushrelieved", "explosiveharley", "smallintdeschutes", "loathsomegrumble", "alluvialsend", "mindglasses", "elatedalarming", "hawseagenda", "grimleybrazos", "quotienttail", "paperclipsweltering", "casesevanescent", "graniticshaula", "saintquokka", "barkraspberry", "smilingsaguenay", "eynortperiod", "labcoatditton", "cookiescalby", "poyntoncopy", "ageschemical", "achingchest", "irishcyrus", "shortbreadunripe", "overcookedrolled", "treenailradish", "realmthrasher", "travelerhefei", "scientificzodiacal", "afanheart", "indicespools", "resultslichen", "leoturn", "welltremble", "sornhick", "displayedsycan", "forwardupset", "pretendslips", "shovelsnapping", "policiesghost", "cloverproduce", "gizasirius", "groinshergar", "geoffreycuts", "ligamentlizard", "mincestoppers", "thumbpoll", "bananafaraday", "liftedcab", "dancerbuttons", "dieselrico", "harecheetah", "poodlewelcome", "cheshirelexus", "linglymphoma", "gelcavus", "charlestonspider", "tardypost", "bobolinknugget", "wormsphoenix", "citrinerogue", "beggarlynewman", "dialectshag", "flabbyalfred", "shipsmarske", "midpointextralarge", "cockneybungalow", "piratecambridgeshire", "paranoidmeteorite", "ragecatalysts", "cranbrookrabai", "pigjumpringworm", "faltercolburn", "hampbaloo", "pointsmeta", "chemistrydemurrage", "mainmastyoda", "etherealcred", "finchgoalie", "lightyearitself", "oreoproton", "hoovesrecent", "planemoniobrara", "approachbreasts", "slovenianpredictive", "cyclicjarring", "peaseyforesail", "maskdoting", "michigantoronto", "bandanasstudent", "munchingnotebook", "lincolnshirebolt", "dolphinapply", "hannadecent", "kindergartenindiscreet", "dysnomiahanoi", "gaudysociable", "wobblyursa", "keyhalladale", "hamstermixtape", "heidifrida", "depressedcarillon", "aniakchakjackie", "purserupture", "triangulumencoding", "ariesbattery", "saultbio", "nikkipeanuts", "napoleonmadison", "keplersoon", "lioncyclone", "bookerapollo", "arsexenon", "busysores", "lickshirtsinbulk", "furphyzunyi", "pixiegambling", "bundevaramunted", "eddiespanish", "dictatewest", "indianapolislackluster", "uncheckedjellies", "bugromeo", "beaveraled", "northamptonshirepluto", "tastesign", "hairhocks", "officejimmy", "cockroachtrouble", "coveringcowbird", "elsecounselor", "cornsincere", "flickrcamel", "usdunicode", "humtwitter", "footroundup", "electricsecondhand", "roentgeniumrhombus", "actintransferred", "sledgeargill", "scientifichassium", "pignutditton", "opennaden", "photothrilling", "forelimbburp", "ceramictern", "eatableunchin", "hullabaloobarnaby", "tearsquiche", "closurepeeve", "robertsapplaud", "averonpolyester", "droppingstatics", "cleverupright", "intervalessential", "polewrestlers", "keyliberty", "inwee", "peelwavelength", "maniacalrelax", "insulateaddition", "shawdonsoot", "brockvillefig", "inventedheat", "alsorift", "newtownjab", "wenzhoualibaba", "clappedcaluminous", "logoutfabulous", "purchasingbeeper", "sumardalesteinbach", "bavinonyx", "trainingdash", "missionbollers", "mosedaleaccess", "gateautufted", "noodlesknives", "whimsicalarray", "answerhandler", "pacificintegers", "cartierchallenges", "bangersbiscuits", "lamzoe", "harminternal", "professedward", "envymisty", "vugobsequious", "britishshelter", "nurserydome", "hinneysky", "foldingtip", "flavorfulbaps", "tentequality", "trainedcarn", "aspenstrikethrough", "halidedemurrage", "tubbytripadvisor", "harmlessopencart", "weeklyimmersion", "universalblob", "calcitegeronimo", "montanarockwell", "crashingsnore", "occultationvenogram", "daddyjansky", "emeraldremington", "runservlet", "abstractedterminally", "coloradobugs", "dessertsfea", "samvictoriaville", "cheyennedownholland", "birdsscared", "spacersanchor", "obsessedprime", "glossopal", "rhodiumseeka", "badgworthypalette", "jumbowool", "farnackeveryone", "crimdonmine", "sycanminutes", "gwaunmontreal", "tobermoryplonk", "magicsaskatoon", "squawkcomb", "compresspanjandrum", "indigoeight", "draughtspheroid", "sophitaz", "bullockssparkle", "mangledwaterloo", "cullionsdroppings", "livermoriumpants", "magellanicbellart", "accurateliberated", "screechingbold", "blockbenny", "samariumpissed", "geminideer", "relaxwagger", "faithfulcar", "nerodidactic", "prependrobonaut", "bobblygazebo", "takeoutalarmed", "bitchstrawberry", "craftsmanrowing", "eyepieceheavy", "lincolngrange", "roskhillfume", "fawrhenry", "syllableshorn", "oldhop", "poopeeler", "cocklefurious", "muggingnumnah", "earnestintend", "contenthungarian", "piggychalky", "lutetiumapplies", "fallopianstirring", "leanpiquillo", "derbyshireserpens", "mixinracked", "floppunctual", "starvelingconfucius", "sneeralydar", "barbreckclick", "romeoswainson", "plaitedwoodpecker", "asphalttoasted", "warenrat", "willetsiberian", "cheesybowen", "rosaceachancellor", "instagramcurium", "colloquialember", "faithfulfire", "ferocioussdraught", "filletsape", "frogsslimy", "numerouschanel", "nicoisejimbo", "confirmedecozone", "thickdespairing", "testsdewberry", "antlilly", "marriedhelvetica", "quarterlyeast", "spiritbutcher", "ripeinstinct", "stiffstaking", "boysudbury", "oncowboys", "fillerturkey", "windownorma", "tinyinfirm", "oberonorogeny", "newmanlarge", "wallopthunder", "sinepinto", "observechildren", "venerealglowstone", "journalvomit", "wallophuygens", "filterzodiacal", "fellowshipforget", "reggiesculptor", "therapyfairs", "braytonlesser" };
            for (int i = 0; i < 50; i++)
            {
                Player[] ppl = names.Take(random.Next(6, 50))
                               .Select(x => new Player(x))
                               .ToArray();
                int    ind = random.Next(1, random.Next(5000, 50000));
                string ans = ppl[(ind + ppl.Length - 1) % ppl.Length].Name;

                string sut = DuckDuckGoose.PlayDuckDuckGoose(ppl, ind);

                NUnit.Framework.Assert.AreEqual(sut, ans);
            }
        }