Click here to Skip to main content
15,885,366 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: How to store huge binary files without Database Pin
jschell13-Aug-13 8:42
jschell13-Aug-13 8:42 
GeneralRe: How to store huge binary files without Database Pin
Mercurius8413-Aug-13 14:54
Mercurius8413-Aug-13 14:54 
GeneralRe: How to store huge binary files without Database Pin
jschell15-Aug-13 8:49
jschell15-Aug-13 8:49 
GeneralRe: How to store huge binary files without Database Pin
Mercurius8415-Aug-13 15:28
Mercurius8415-Aug-13 15:28 
QuestionMoving away from Microsoft eCommerce Server tool Pin
vkEE2-Aug-13 7:04
vkEE2-Aug-13 7:04 
AnswerRe: Moving away from Microsoft eCommerce Server tool Pin
jschell2-Aug-13 14:27
jschell2-Aug-13 14:27 
QuestionBPMN question Pin
yousefshokati1-Jul-13 21:54
yousefshokati1-Jul-13 21:54 
QuestionTesting Question Pin
AnalogNerd28-Jun-13 3:04
AnalogNerd28-Jun-13 3:04 
I'm fairly new to writing unit tests and I've run into something of a design/architecture question.

I'm operating under the belied that any given method should not be overly large, and any that is should be refactored into smaller methods.

As a result I end up with this:

C#
public MyClass : IMyClass
{
    public string MyMainMethod() 
    { 
        Method1();
        Method2();
        return "somestring";
    }

    private void Method1()
    {
        // some code
    }

    private void Method2()
    {
        // some other code
    }
}


Obviously this is grossly simplified, but it serves my purposes for this question. I have my classes loosly couples so when writing a unit test I can stub any interface that is injected into MyClass and isolate the code under test.

How do I go about stubbing Method1 and Method2? I'm using Moles (and can't change because of company restrictions), but I suspect/hope this is a testing platform independent question.

Should I be desiging this different? Not using private methods, but public virtual would allow me more flexibility, but doesn't feel like the right approach.

Any advice or pointers would be greatly appreciated.

- Andrew
AnswerRe: Testing Question Pin
Pete O'Hanlon28-Jun-13 3:52
mvePete O'Hanlon28-Jun-13 3:52 
GeneralRe: Testing Question Pin
AnalogNerd28-Jun-13 4:09
AnalogNerd28-Jun-13 4:09 
AnswerRe: Testing Question Pin
Bernhard Hiller1-Jul-13 0:40
Bernhard Hiller1-Jul-13 0:40 
AnswerRe: Testing Question Pin
Keld Ølykke13-Jul-13 1:32
Keld Ølykke13-Jul-13 1:32 
QuestionDesign of complex decission modules Pin
Kreatief27-Jun-13 21:15
Kreatief27-Jun-13 21:15 
AnswerRe: Design of complex decission modules Pin
Bernhard Hiller1-Jul-13 0:47
Bernhard Hiller1-Jul-13 0:47 
Questionconcurrent object oriented system Pin
N_cooL26-Jun-13 21:54
N_cooL26-Jun-13 21:54 
AnswerRe: concurrent object oriented system Pin
Richard MacCutchan26-Jun-13 22:27
mveRichard MacCutchan26-Jun-13 22:27 
GeneralRe: concurrent object oriented system Pin
N_cooL26-Jun-13 22:36
N_cooL26-Jun-13 22:36 
GeneralRe: concurrent object oriented system Pin
Eddy Vluggen26-Jun-13 22:39
professionalEddy Vluggen26-Jun-13 22:39 
AnswerRe: concurrent object oriented system Pin
Eddy Vluggen26-Jun-13 22:37
professionalEddy Vluggen26-Jun-13 22:37 
QuestionLatency in display images Pin
vkEE19-Jun-13 7:53
vkEE19-Jun-13 7:53 
AnswerRe: Latency in display images Pin
Bernhard Hiller19-Jun-13 20:49
Bernhard Hiller19-Jun-13 20:49 
AnswerRe: Latency in display images Pin
José Amílcar Casimiro24-Jun-13 2:33
José Amílcar Casimiro24-Jun-13 2:33 
AnswerRe: Latency in display images Pin
Marco Bertschi25-Jun-13 23:07
protectorMarco Bertschi25-Jun-13 23:07 
QuestionWhy MVC Pin
KK Kod16-Jun-13 21:51
KK Kod16-Jun-13 21:51 
AnswerRe: Why MVC Pin
Richard MacCutchan16-Jun-13 23:21
mveRichard MacCutchan16-Jun-13 23:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.