Improvement / Standardization of PackageSetting and TestPackage APIs
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
A TestPackage contains an enumeration of settings of type PackageSettings. Both classes have methods that operate upon and modify the contained settings.
PackageSettings has three basic methods that operate on it's contained settings: Add, Set and Remove. Each of these has several overloads, which are not relevant to this discussion.
Addadds a new setting. It fails if the setting is already present.Seteither adds a new setting or updates an existing one.Removeremoves a setting.
None of these operate on any sub-packages.
**TestPackage has the single method AddSetting, which calls PackageSettings.Add recursively, so that the same setting is added to the package itself and all its sub-packages. There is no equivalent for either Set or Remove.
I'm proposing to generalize this approach and optionally to remove the AddSetting method. Specifically...
- Give
PackageSetting.Add,SetandRemovean additional boolean argument in all overloads, i.e.bool recursive.
- When true, the call would apply to the package itself and all contained subpackages.
- The argument could be optional (in which case it should default to false) or required. What do folks think?
- If we prefer having additional overloads rather than adding the new argument to each existing overload, I'm OK with that, but the optional arg seems simpler to me.
- We need some consistent approach for
TestPackage. We could do any of the following, which are listed in my own order of preference...
- Eliminate
TestPackage.PackageSetting. Clients calling it would have to useTestPackage.Settings.Addwith the value ofrecursive` specified as true. - Create
TestPackage.Add,SetandRemove. This would add no functionality but save a bit of typing. Clients would useTestPackage.Addetc. rather thanTestPackage.Settings.Add. RemoveTestPackage.AddSettings. - Like the previous but retain
TestPackage.AddSettings.
From the point of view of the Console Runner, this is merely a refactoring. No real functionality is affected. However, other clients, like the VS adapter and the TestCentric GUI will benefit by not having to perform recursion themselves.
So all points of view are covered, I'm asking for comments from the @nunit/engine-team, @OsirisTerje and @rowo360.
- Lingua principale
- C#
- Stelle
- 0
- Fork
- 0
- Merge medio
- 3g 13h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
bug priority:low severity:S3
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
squid-farm/talewright#909 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
kronos:develop:queued priority:P0
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
priority:P2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100