473,587 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Structuring a solution / projects.

Hi,

I'm new to Visual C# and I am looking for guidance with structuring
projects.

I am wanting to develop a DLL assembly which will contain all my common
classes which will be used by various projects. During development of
this DLL assembly I have decided to have a second project which will be
a console application whose entire job is to run code to test the
classes to iron out bugs etc.

I have structured this in the following way:
A. I have a solution called XYZCommon (where XYZ is the Company Name).

B. This solution has two projects. Project 1 is called XYZCommon and
will create the DLL assembly. Project 2 is called XYZCommonTest which
is a console application. This will contain the code to test the
classes in XYZCommon.

C. Project XYZCommonTest is set as the Startup Project for the
solution. It also references project XYZCommon.

D. Project XYZCommonTest has multiple 'static void Main(string[] args)'
entry points in different classes. Each entry point will run a test for
the corresponding class in XYZCommon.

E. Before I run each test I set the required entry point as the Startup
Object property in project XYZCommonTest's project property page.
This set up is allowing me to edit and test each class as I go within a
single solution. Is this a sensible way to develop and test a DLL
assembly? What do other people do?
Thanks in advance for any advice!

Oct 21 '06 #1
7 1724
PS
<Jo********@hot mail.co.ukwrote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
Hi,

I'm new to Visual C# and I am looking for guidance with structuring
projects.

I am wanting to develop a DLL assembly which will contain all my common
classes which will be used by various projects. During development of
this DLL assembly I have decided to have a second project which will be
a console application whose entire job is to run code to test the
classes to iron out bugs etc.
The seperate assembly is perfectly acceptable if the tests are acceptance
tests. Acceptance tests deal more with the public interface to your code and
are closer to what the user of the software is expecting. If theses tests
are unit tests then they should be within the assembly to avoid having to
expose your internal methods as public methods (so you can test them from
another assembly). Note that there is a thing called friend assemblies that
allow one assembly to see another assembly's internal methods but I have
never done this.
>
I have structured this in the following way:
A. I have a solution called XYZCommon (where XYZ is the Company Name).

B. This solution has two projects. Project 1 is called XYZCommon and
will create the DLL assembly. Project 2 is called XYZCommonTest which
is a console application. This will contain the code to test the
classes in XYZCommon.

C. Project XYZCommonTest is set as the Startup Project for the
solution. It also references project XYZCommon.

D. Project XYZCommonTest has multiple 'static void Main(string[] args)'
entry points in different classes. Each entry point will run a test for
the corresponding class in XYZCommon.

E. Before I run each test I set the required entry point as the Startup
Object property in project XYZCommonTest's project property page.
I would think that eventually you will want to run all the tests as a batch
so I would keep to one Main method and from that method start your tests. If
you are wanting to work on one test or one set of tests (all tests within a
test fixture) then you could use a command line argument. That is what NUnit
does.
>

This set up is allowing me to edit and test each class as I go within a
single solution. Is this a sensible way to develop and test a DLL
assembly? What do other people do?
It should not be test and move on never to run that test again. At least
once a day all tests should be run and all tests should be run before
checking in your code (you are using something like SourceSafe, right?)

PS

Oct 21 '06 #2
MMA
Sounds about how we test our BL dlls however I don't really see the need to
have multiple entry point within your XYZCommonTest project. You can set up
the calls with the same class to test the various classes in XYZCommon.dll
but pass in an arg to your test app, which will be used to determine which
class you would like to test.

Example to test you to test the valdation class in you dll pass an arg =
"Validate"
Which your test app will then use to determine that it needs to test the
validate methods exposed on your XYZCommon's facade.

Hope this was helpful.

"Jo********@hot mail.co.uk" wrote:
Hi,

I'm new to Visual C# and I am looking for guidance with structuring
projects.

I am wanting to develop a DLL assembly which will contain all my common
classes which will be used by various projects. During development of
this DLL assembly I have decided to have a second project which will be
a console application whose entire job is to run code to test the
classes to iron out bugs etc.

I have structured this in the following way:
A. I have a solution called XYZCommon (where XYZ is the Company Name).

B. This solution has two projects. Project 1 is called XYZCommon and
will create the DLL assembly. Project 2 is called XYZCommonTest which
is a console application. This will contain the code to test the
classes in XYZCommon.

C. Project XYZCommonTest is set as the Startup Project for the
solution. It also references project XYZCommon.

D. Project XYZCommonTest has multiple 'static void Main(string[] args)'
entry points in different classes. Each entry point will run a test for
the corresponding class in XYZCommon.

E. Before I run each test I set the required entry point as the Startup
Object property in project XYZCommonTest's project property page.
This set up is allowing me to edit and test each class as I go within a
single solution. Is this a sensible way to develop and test a DLL
assembly? What do other people do?
Thanks in advance for any advice!

Oct 21 '06 #3
<Jo********@hot mail.co.ukwrote :
I'm new to Visual C# and I am looking for guidance with structuring
projects.

I am wanting to develop a DLL assembly which will contain all my common
classes which will be used by various projects. During development of
this DLL assembly I have decided to have a second project which will be
a console application whose entire job is to run code to test the
classes to iron out bugs etc.
Any reason for using a console application rather than having unit
tests using a commonly available framework such as NUnit? Then the
tests could either live in another library project, or if you don't
mind them being shipped (or want to use conditional compilation to
exclude them) they could live in the same project as the production
code.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 21 '06 #4
Thanks to you all!

I've downloaded the NUnit stuff (never heard of it before) and had a
quick look and it seems to be able to provide all the functionality I
require.

As it's early on in my development I will be able to convert my
validation / test code to be used by NUnit.

Thanks again!

John.

Oct 22 '06 #5
PS

<Jo********@hot mail.co.ukwrote in message
news:11******** *************@k 70g2000cwa.goog legroups.com...
Thanks to you all!

I've downloaded the NUnit stuff (never heard of it before) and had a
quick look and it seems to be able to provide all the functionality I
require.

As it's early on in my development I will be able to convert my
validation / test code to be used by NUnit.
Also check out TestDriven.net. This is a Visual Studio add in that allows
you to run a test from within VS and understands the NUnit test fixtures.

PS

Oct 22 '06 #6
* PS wrote:
>
<Jo********@hot mail.co.ukwrote in message
news:11******** *************@k 70g2000cwa.goog legroups.com...
>Thanks to you all!

I've downloaded the NUnit stuff (never heard of it before) and had a
quick look and it seems to be able to provide all the functionality I
require.

As it's early on in my development I will be able to convert my
validation / test code to be used by NUnit.

Also check out TestDriven.net. This is a Visual Studio add in that
allows you to run a test from within VS and understands the NUnit test
fixtures.

PS
Can you use an App.config with TestDriven, like you can with NUnit?

Oct 23 '06 #7
PS

"Angel Of Death" <af***@23o.1f.c o.ukwrote in message
news:eh******** ***@custnews.in web.co.uk...
>* PS wrote:
>>
<Jo********@ho tmail.co.ukwrot e in message
news:11******* **************@ k70g2000cwa.goo glegroups.com.. .
>>Thanks to you all!

I've downloaded the NUnit stuff (never heard of it before) and had a
quick look and it seems to be able to provide all the functionality I
require.

As it's early on in my development I will be able to convert my
validation / test code to be used by NUnit.

Also check out TestDriven.net. This is a Visual Studio add in that
allows you to run a test from within VS and understands the NUnit test
fixtures.

PS

Can you use an App.config with TestDriven, like you can with NUnit?
Yes, it will use the MyDll.dll.confi g file in the output path directory.

PS

Oct 24 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
510
by: Simon Jefferies | last post by:
Hello, I'm getting a strange problem where when I load up my solution that has three projects:- a managed C++ .NET, one C++ lib, and a VB library. It locks up and doesn't load completely, I have to do the following to work around it.
0
1634
by: TEK | last post by:
Hello We have a quite huge project. To limit the solution size, rebuild time and so on we have divided the project in two different solution. One solution that holds the buiness entities, or mapping and stuff like that. One solution that holds the application, windows controls and stuff like that.
14
1844
by: Steven T. Hatton | last post by:
Is there a more or less accepted authority describing how to structure a project? I know Julie has asked about namespaces. That is certainly a part of my question, but I want to know about the whole picture. If such a thing doesn't exist, then would someone with enough name recognition to have an influence please decree such a guideline. ...
1
1059
by: Simon Harris | last post by:
Hi All, I work in a team of three developers. 99% of our work is developing 'applications' for our organisations Intranet - mainly whats become known to us as e-employee apps, such as sickness/holiday reporting/authrisation, handling the new starter/leaver processes, etc...the list goes on. Up to recently, we have been developing in...
1
2064
by: Ravi Chaudhary | last post by:
Hi, We are using VS.Net 2003 and coding in VB.net. The solution has 38 projects; most of the projects in the solution reference other projects (without any circular references) and all the references were added to using the Projects tab on the Add Reference dialog and not by browsing to the DLL for the project. When we build or run the...
3
6828
by: Danny | last post by:
Hi I trying to master msBuild but have a problem. I have a solution that I wish to build using msbuild but want to override BeforeBuild/AfterBuild targets for each of the projects. I trying to avoid modifying the common.targets etc and the individual project .sln files and just do it within a solution proj. One method I've tried, is to...
1
1912
by: Ronald S. Cook | last post by:
If I choose not to include a dependent project in my solution, but rather just reference the .dll in that project's bin\debug folder, are there any negative repercussions? Or, is it more normal/better to just go ahead and include that project in the solution? I'm thinking I would prefer the prior because we have alot of projects and most...
4
3554
by: | last post by:
I have learned about compartmentalizing my code base using Class Libraries. I have my common code such as my ORM framework broken out into their own Class Libraries, which are referenced as projects from my Website. I also have a common set of DLLs I use across all of my applications. It would be great if I could put all of those DLLs into...
3
2154
by: Manikandan | last post by:
Hi, I'm copying projects from a solution in the vss. In my local system i created solution ,added that project(make modification related to solution) When i added this solution to vss, projects are referred to the original solution not from my new solution I will explain more clearly i have project folder in vss(v4.5) v4.5(folder)...
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.