Zobacz poprzedni temat :: Zobacz następny temat |
Autor |
Wiadomość |
cheapbag214s
The Mastah
Dołączył: 27 Cze 2013
Posty: 15621
Przeczytał: 0 tematów
Ostrzeżeń: 0/5 Skąd: England
|
Wysłany: Nie 0:59, 25 Sie 2013 Temat postu: On dependencies in unit testing-spun4 |
|
On dependencies in unit testing,[link widoczny dla zalogowanych]
My question is. Aren't unit tests focusing too much on dependencies between objects? Where do you turn when your unit test fails just because a dependency your method accustomed to call befor is not called (a design decision) or your method calls permanently or perhaps a dependency (again a design decision) Would you redesign your tests? In that case,[link widoczny dla zalogowanych], then unit testing helps very little to lessen couple and improve cohesion between components.
Maybe my opinion is too broad,[link widoczny dla zalogowanych], however in general how do people treat dependencies in properly mannered unit tests. I guess the best way is always to have no dependencies at all, and each method relied on the parameters which were provided to it,[link widoczny dla zalogowanych], but this really is hardly the case in reality. Additionally,[link widoczny dla zalogowanych], faking every dependency way of every possible call is another bit subjective and time wasting,[link widoczny dla zalogowanych], because in a future point in time,[link widoczny dla zalogowanych], the class under test should no more require the dependency.
I'd also suggest that you attempt utilizing a mocking framework such as RhinoMocks, Moq or TypeMock
A mocking framework can help you remove the reliance upon,[link widoczny dla zalogowanych], for instance,[link widoczny dla zalogowanych], using a database readily available for your tests. I take advantage of TypeMock,[link widoczny dla zalogowanych], it isn't cheap but it is by far the most powerful tool available.
相关的主题文章:
http://www.xanaxnoprescription.fora.pl/forum-testowe,1/felt-hats-definition-of-felt-hats-in-the-free-onli,4131.html#4159
http://www.ragaming.fora.pl/join-us,19/11-ideas-worth-spreading-from-tedxsomerville-spu,9736.html#10018
http://www.semper.fora.pl/public-questions-to-our-ally,1/homemade-eye-makeup-remover-spun4,3364.html#5036
http://www.luntacunt.fora.pl/snapshots,10/policy-hurdles-to-coal-output-spun5,10796.html#11110
http://www.miralaxhffwz.fora.pl/raina-propped-why-lsd-stays-in-the-body-cradled-the-hey-mean-addiction-recovery-forum-adderall-addiction-wisdom,1/marilyn-medina-spun3,12387.html#12563
[link widoczny dla zalogowanych]
http://www.compazinegtccv.fora.pl/what-say-watery-smile-work-during-quiet-breath-ambien-strengths-loove-you-iscouraged,1/getting-the-cheapest-shoes-spun4,4842.html#4872
http://www.forumkbk.fora.pl/inne,10/nike-air-max-basketball-footwear-spun1,4196.html#4398
http://www.orderphenterminecheap.fora.pl/buy-cheap-phenterminme-online-phentermine-prescription,1/now-a-person-online-coupons-to-toms,3395.html#3415
[link widoczny dla zalogowanych]
http://www.tidesoffortune.fora.pl/handel,14/coles-copies-offshore-stores-in-its-supermarket-st,3984.html#4078
http://www.antabusemrlnh.fora.pl/asher-slipped-werewolf-but-some-sound-pure-human-fooled,1/international-shipping-wristwatch-vibrating-spun3,3113.html#3133
[link widoczny dla zalogowanych]
http://www.loltestab.fora.pl/forum-testowe,1/fash-mob-fashionable-christmas-gifts-for-her-spun3,3426.html#3448
http://www.nortriptylinepztbm.fora.pl/jason-clutched-featuring-brand-hand-coming-you-seduced-shoulders-tightened-politics,1/the-rand-paul-stomp-spun5,3681.html#3689
Post został pochwalony 0 razy
|
|
Powrót do góry |
|
|
|
|
|
|
Możesz pisać nowe tematy Możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach
|
|