Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 17th, 2004, 07:05 AM
Registered User
 
Join Date: Aug 2004
Location: , , Botswana.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Classes

I have multiple classes in a Console Application.
I am wrting a test class,

I want to take an instance of this class below:-
public class Collect
{
public static void EnterDetails()
{
Console.WriteLine("Please enter a number");
string number1 = Console.ReadLine();
Console.WriteLine("Please enter another number");
string number2 = Console.ReadLine();
Convert.ConvertString(number1, number2);
}
}

********This is the test class
using System;
using NUnit.Framework;

namespace Add_Multiply_Divide
{
[TestFixture]
public class Class2
{
public Class2()
{
}
[Test]
public void RunMain()
{
//Start.Main();
}
[Test]
public void TestConvert()
{
Collect col = new Collect();
col. *** I want the EnterDeatils method to appear here

Please could someone tell me why.

CodeMonkeys
 
Old August 18th, 2004, 01:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Why --- you have written the code you should know why.

If you meant to say 'how?', well having written the two classes yourself I expect that you would know how to call a member function. I've not tried the code at my end, but if you have any perticular problem with this code you can always wright back.

Ankur
 
Old August 18th, 2004, 08:37 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I don't even understand what the question is on this.

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old August 18th, 2004, 11:14 AM
Registered User
 
Join Date: Aug 2004
Location: , , Botswana.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

FAO Ankur

I am trying to write a test class for NUint,
Sorry i did mean How but i will wright back


CodeMonkeys




Similar Threads
Thread Thread Starter Forum Replies Last Post
Using classes seymour_glass C# 1 April 26th, 2007 10:18 PM
HELP Problem With Classes nichola_x_rose ASP.NET 2.0 Professional 0 March 17th, 2007 07:56 AM
classes dhoward VB.NET 2002/2003 Basics 2 November 8th, 2006 10:35 AM
About Classes. wdw BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 July 29th, 2005 08:46 AM
Classes digby_dog VB.NET 2002/2003 Basics 1 May 2nd, 2005 09:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.