Creating Get/Set Properties For Interfaces And Using Them In Mock Objects?

Jan 19, 2009

I am having trouble assigning values to the properties defined in the mock objects.

Public Interface IAddCustomerView
Property FirstName() As String
Property LastName() As String
Property Message() As String
End Interface

My unit test below always fails saying that getMessage was never called:

<Test()> _
Public Sub Should_Display_A_Success_Message()
_presenter = New AddCustomerPresenter(_view, _repositoryStub)

[code]....

View 1 Replies


ADVERTISEMENT

Creating A Mock Configuration Setup?

Nov 29, 2011

The program I am building requires a lot of initial user input. I was wanting to stream line this by creating a 'config' file so to speak that after the user enters all the initial data they can click a button that will save their entries into a secure file. When they leave for the day and come back they can click the load button and it auto fills in all the relevant data that will be stored in the file.

Still digging through the MSDN for help, but no luck on options yet.

I was thinking save the information to a text file somehow, but passwords will be stored and I would like to make it secure if possible.

View 7 Replies

"Expected Invocation On The Mock At Least Once But Was Never Performed" Error When Setting Up The Mock

Oct 26, 2011

I'm getting this error from Moq via NUnit, and it doesn't make much in the way of sense to me. "Expected invocation on the mock at least once, but was never performed: x => x.DeleteItem(.$VB$Local_item)"

[Code]...

View 1 Replies

Modifying Objects Inside For Each Loop Sets Properties Of All Objects With Values Of Last One?

Jan 29, 2011

I have a program like this.

Module Module1

Public Class Mstr
Public Property Prop1 As String
Public Property Prop2 As String[code]....

But it is not working as I expect it to. You can see it from.The DtlsB properties of all three DtlsA objects are having values from last iteration.

View 1 Replies

Creating Array/list From Loaded Interfaces?

Aug 24, 2010

I'm having trouble creating a global array that i can use in other functions.

I have this code right under "Public Class myClass":

Dim LoadedPlugins As Array

Then in a function I have this:

Dim PluginList As String() = Directory.GetFiles(appDir, "*.dll")
For Each Plugin As String In PluginList
Dim Asm As Assembly

[Code]....

Now obviously that doesn't work, how can I add the tmpPlugin to an array or list so I can use it in other functions?

The main thing I need to be able to do is loop through all the loaded plugins and execute the CustomFunction in a separate function than the one that loads the plugins listed above.

View 1 Replies

Copy Properties Of Objects

Dec 28, 2009

MustInherit Class Z
Public Property Name() As String
Get
Return strName

[Code]...

' What I am looking here is, I wanted to copy all the (inherited object properties of class Z is common for both A & B) common property values of object A into object B without accessing properties independently eg: objB.Name = objA.Name (Don't want to do like this)

End Sub
End Class

View 1 Replies

Access Objects / Properties In An Application From Another DLL

Jan 31, 2006

I have an application which is grouped in a MainApplication and serveral Modules (DLL's) The Main Application is basicly a Form with a NavigationBar on the Left Side (like in Outlook 2003) and an MDI-Parent. There is also a Simple Login Routine on this Form. I store the UserName after Loggingn to a Property. The DLL's holds functionallity and Forms for various Sections for example there is a Employee.dll which holds functions and a form to show all Employees.

On Loading of the Main Application I loop trough all dll's in a "Module"-Folder and extract NavigationItems from them which I add to the MainForms NavigationPanel. I don't have a reference to the Modules because I want to make it as flexible as possible so that it is possible to delete a Dll form the Module directory in order to remove the functionality from the MainApplication. The Modules could work also without the MainApplication if they are Complied as an exe insted of DLL of course. This works fine so far.

[Code]...

View 2 Replies

Compare Specific Properties Within Two Objects?

Sep 14, 2010

I am trying to compare specific properties within two objects. Example:I want to compare the Last Name, Age, and Sex of two people (Person1 and Person2).

View 3 Replies

How To Call Multiple Objects With Same Properties

Apr 15, 2011

How can I call multiple objects? Example..
nameTextbox.Enabled
addressTextbox.Enabled
ContactTextbox.Enabled
How can I call this objects with same properties...

So rather than typing them all with =True or False...
I just have to type a variable = True or false...
And where will I type the code.

View 9 Replies

IDE :: Any Way To Change Default Properties For Different Objects?

Mar 8, 2012

Is it possible to change the default properties for different objects in the VB6 IDE (I'm sure any version would be similar, but this is the one we are currently using in my programming class in school). For example, is there anyway that automatically, when I create a Label, that it could already have AutoSize set to false, and BorderStyle to Fixed3D, etc.? I feel as if it would work greatly with the amount of time taken to layout my programs.

View 5 Replies

Storing Objects As Properties And Then Accessing Them?

Jan 28, 2011

I want to know the correct way to access an object that is stored as an object in another object...phew. Here is what I'm trying to do...

I'm creating a restaurant map and to keep things simple I have 3 classes -- cServer, cTable and cGuest. cTable has a property which should contain a cServer object eg

Public Property Server() As Object
'Called when the property is read
Get

[Code].....

View 2 Replies

VS 2010 Custom Objects And Properties

Nov 13, 2011

I'm working on a project where I need to information on all the monitors connected to a computer and then write a configuration file based on that. I can already get the screen information by creating a new instance of screen and reading the information such as index, bounds and everything else.I'm trying to create a virtual screen object to hold the information from the screen so I can work with it, or add other properties to it.[code]This all works perfectly how I want it to. Except I would like to do one more thing. How can I make it so that instead of getting Virtual_Screen.Top, I could get Virtual_Screen.Bounds.Top? That way I could create other properties such as Virtual_Screen.Border.Top..I have no idea how to code, or what that would be called. It's hard to search for something you don't know the name of.

View 5 Replies

Changing Datatypes Of Properties Of Serialized Objects?

Jun 18, 2009

Changing datatypes of properties of serialized objects?

View 1 Replies

Something Like Operator Overloading For Only Part Of An Objects Properties?

Aug 21, 2009

For good reasons I would like to have something like truckA = truckB + truckC where only the loads of the trucks are added, not the license plate numbers. Also I don't really want to return a new object (lots of overhead), just change one or two of the properties. Only thing I can come up with is truckA.Load = truckB.Load + truckC.Load, or at best truckA.Load = truckB + truckC which still doesn't look elegant, and - worse - still requires the creation of a new Load object.(this is just a way of stating my problem; the real objects are quite big and complicated) Currently I have a Sub isSumOf so the code reads TruckA.isSumOf(truckB, TruckC)

View 4 Replies

Sorting Objects In Arraylist By One Of The Object's Properties?

Aug 30, 2011

I have a group of objects stored in an arraylist. These custom type objects have a number of properties from their underlying class . I want to use one of the properties to sort the array. I cannot determine which Array.Sort method to use.

I want to sort based on an integer property. Virtually every example I can find involves sorting strings.

So, assume the Objects have the following properties.

Obj.name as string
Obj.ID as integer
Obj.Alive as boolean

The objects are kept in an arraylist called FriendsOfMine.

I want to be able to order the list by Obj.ID, both ascending and descending in value.

View 12 Replies

Starting Properties Of Objects In Winforms Form?

Jun 11, 2012

In my software course, each time we submit an assignment, we have to include a document with the starting properties of each object in a form.

E.g.

TextBox1
Location: 241, 115
Name: TextBox1
Size: 100, 20
TabIndex: 0

It's a real pain to scroll through the properties viewer and copy and paste each customised value for 30+ objects on a form... I was wondering if there'd be an easy piece of code or way about getting an (at least partially) automated printout/view of all the properties of the objects.

Was thinking some sort of private sub I could past into the bottom of the program and run on load, that gets all objects, and outputs the non-default properties to a report or something?

View 1 Replies

Accessing Hidden Properties Of Excel 2007 VBa Objects

Jun 22, 2009

I need to migrate from Excel 2003 VBA to Excel 2007 VBA. When Microsoft introduced Excel 2007 it removed many objects from the previous versions and added some new objects. Also it hid some properties of particular objects. These hidden properties can be viewed by going to the object browser, right clicking any object and selecting "Show Hidden Members". My problem is I need to access these hidden properties. Is there any way I can access these properties. I can successfully migrate from Excel 2003 VBa to Excel 2007 VBA with the same functionality?

View 5 Replies

Get 'memberOf' Properties For Computer Objects In Active Directory

Jul 28, 2011

I apologize if this is the wrong forum. I'm searching for all computer objects in an OU in Active Directory. I'm able to get the computer name, DN, and description but cannot get the memberOf properties. I'm wanting to get all groups the computer is a member of. My code is below:

[Code]...

View 2 Replies

Showing Properties Of Child Objects In The Property Grid?

Mar 9, 2010

I have a custom class (Class1) with a bunch of properties. One of the properties of this class is another custom class (Class2) with its own properties.I have a property grid with the selected object set to Class 1. I can see Class 2 as a property, but i would like to expand Class 2 to show its properties in the same property grid.

Im basically trying to do the exact same thing as the Font Class on a form. If you look at the properties of a form in the designer, you can see the font property. You can then expand that to show the properties of the font class.

View 1 Replies

Implementation - Loop To Update Properties Of Each Object Of A Set Of Custom Objects

Jan 4, 2010

I am using a loop to update properties of each object of a set of custom objects. The routine knows which controls to update because the controls value is not empty, I don't want the routine setting the corresponding properties to nothing when the control is empty. Now I know how to do this perfectly fine with IF statements such as:

CODE:

But this feels really redundant doing that same IF block over and over for each property/control combination, I thought about creating a separate routine that takes the control as an argument and does all the repetitive IF blocks but I don't know how I could also pass an object property to tell the routine to update that particular property.

View 1 Replies

Creating Classes And Objects?

Apr 10, 2011

1) Add a Private variable named _area2) Associate the _area variable with a Property procedure called Area3) Change the CalculateArea method to a Sub procedure. The method should calculate the area and then assign the result to the _area variable.4) Include a parameterized constructor in the class. The constructor should accept one argument: the side measurement. After using the Public property to initialize the Private variable, the constructor should automatically call the CalculateArea method.At this point I believe I've completed the first 2 steps for the Square method, but I'm not sure where to go from therHere is my code for the Square class and the Main Form, in tha order:

Public Class Square
Private _side As Integer
Private _area As Integer

[code].....

View 3 Replies

Creating Two DateTime Objects?

Nov 18, 2009

1. Write a Visual Basic Console Application which creates two DateTime objects. One DateTime object should be used to store a value for date purchased. The second DateTime object should be used to store a value for date paid. See below for more information.

2. Assign values to the two DateTime objects.

3. Use the toString method to display the two DateTime objects.

4. Compare the two dates to determine which date occurred first.

5. Compute the number of days elapsed between the two dates.

6. If the date purchased occurred before the date paid, display: The number of days required to receive payment was ________. Replace the _________ with the number of days computed between the two dates.

On the other hand, if the date paid occurred before the date purchased, display: The number of days this order was pre-paid was _______. Replace the _________ with the number of days computed between the two dates.

If the two dates are identical, display: The payment was received on the same date as the purchase.

View 1 Replies

What Are Classes , Objects , A Namespace , Subroutines,functions,methods,properties And Difference Between Byval And Byref

Jun 26, 2010

I want to know what are classes , objects , a namespace , subroutines,functions,methods,properties and differemce betweem byval and byref in your words.

View 18 Replies

.net Creating Objects In An Array With Events

Jul 25, 2011

I'm having a problem at the moment developing my application. What i need to do is find out how many modems they are connected to my system and send data to each one in turn. I have the programme working for one modem at the moment.

So I can send data to a modem that i specify, for example a modem on COM port 1. I have functions already that will give me a list of COM ports that I need to open.My problem is that i want to dynamically create a new modem object along side existing modems and store them in a collection.

[Code]...

View 6 Replies

Creating A Class That Contains Other Classes/Objects?

Aug 27, 2010

I'm wondering on how you would go abouts instantiating a class that contains other complex objects. for example an Payment Class which has Date,Time, etc.. and it also holds a reference to a paymethod object which has id,Type,Description etc.. How do you instantiate the payment class with all the other objects without one or the other failing, how do you create the payment class which doesn

View 4 Replies

Creating A String From A Collection Of Objects?

Oct 4, 2010

I have a question. I have a class of Cars that I need to display in a simpli-ish string if they will be sold or not base on their number.

[Code]...

I'd like to display a simple string like this:Cars to be sold: 1, 3-5, 7-8, 11, which is based of the .Sell value.Is there some kind of heuristic to create this kind of string in .NET or is it just a bunch of for/each and if/then and redimming of arrays?

View 2 Replies

Creating Objects Based On Database?

Jun 9, 2011

I have decided I would start small and make a program that would create a "receipt" list in a listbox and a total. Now, I would like the user to be able to add their own "menu" items. I'm assuming the best way to go about this would be to have them actually add it to a database and then a function in the program will refresh the dataset with the new list. However, this is where my problem lies. How can I tell VB .net 2010 that I want to create a new button (or buttons) on the fly, in an orderly pattern on the form, based on the input from a DB?

View 10 Replies

Dynamically Creating And Referencing Objects?

Mar 17, 2009

I would like to dynamically create an object (in my case a thread) and then be able reference that object. Simplistically put, I would like to read from a text file and then process each item using a thread (so that I don't have to wait for each item before starting the next). The problem is that I cannot think of a way to create a new thread dynamically ie. thread name so that I can then wait for all created threads before doing something else.

View 8 Replies

Dynamically Creating Objects At Runtime?

Mar 28, 2009

Is there a way to dynamically create an object at runtime?Background: Basically i have an employee class that i want to instantiate every time an employee logs in. What i don't want it to have an employee object already created for every employee, but when they log in the object gets created.

View 5 Replies

Creating A Command Line Interface With Objects?

Dec 16, 2011

Im considering making my own command line interface with custom commands etc. I was thinking the following objects would be sufficient:

Textbox - for input
Rich text box - for showing processes and output
Button - to insert input

If it can be done, how can I provide line breaks in the output on the rich textbox e.g.

line1: input instruction
Line2: <cp><textfile.txt>
Line3: I/O error, file not found, check file root.

My version of CLI will have no integration with the windows CMD.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved