Verify A Method Was Called Exactly Once Using AAA Syntax

Sep 26, 2010

I am trying to use the AAA syntax in Rhino Mocks with VB.Net to validate that a method was called only one time. I can't seem to get it right. With this code, if the repository is called twice, it returns nothing on the second call, and the test passes. I would have expected the test to fail when VerifyAllExpectations was called.

<TestMethod()>
Public Sub GetDataCallsRepositoryOneTime()
Dim repository As IDataRepository = MockRepository.GenerateMock(Of IDataRepository)()

[Code].....

View 2 Replies


ADVERTISEMENT

Inheritance - Create A Method Called StartWorking() And Want FrmChild To Inherit - Method

Nov 25, 2011

I have a large problem with inheritance in vb.net. The problem is the following:

I have 2 forms => frmBase and frmChild

In frmBase i want to create a method Called StartWorking() and i want frmChild to inherit this method.

But here is the tricky thing: when frmChild.StartWorking is called i would like the following => without calling MyBase.StartWorking()

I want frmBase.StartWorking() to be executed first and after a test in frmBase.StartWorking if blnValue is true then frmChild.StartWorking has to be activated. if blnValue is false that frmChild.StartWorking cannot be activated.

View 2 Replies

.net - When The Property Get And Set Method Has Been Called

Mar 26, 2010

i have the following property declaration

[Code]...

View 2 Replies

Add One Row When Method AddRow() Called?

Apr 4, 2011

i have problem when addnew row at keyup event for datagridview control. i want to add one row when method addRow() called.

View 2 Replies

Javascript - Web Method Not Being Called

Dec 14, 2011

I'm working with a VB.Net page which calls a web method from JavaScript, this was working upto a week ago and now for some reason is not working.

Firstly my page generates a list of items that can be clicked, The line that does this is:

TicketHTML = TicketHTML + "<td><img src='../images/delete.png' Class='imgTicketClose' alt='Delete Task' onclick='DeleteTicket(" + row("id").ToString() + ")' /></td></tr>"

I know this is working as when the item is clicked I get a javascript popup so I would assume the problem is not here.

Now my Javascript:

function DeleteTicket(ticketID)
{
var answer = confirm("Do you really want to delete this task?")

[Code].....

EDIT: Could anything in the web.config file be preventing page methods from executing? I have just noticed this happening with a completely seperate web method and have checked the integers being passed into the javascript with an alert() and they are all valid

View 2 Replies

Shadowed Method Is Not Called

Dec 30, 2010

I have a class which i realized will not always correctly instantiate and as a quick fix, i figured i'd subclass it and shadow a few methods so that the program can continue to run without exploding. When i run the software, calls to the methods resolve to the base's implementations and not the subclass. I'm using VB.NET with .NET 2.0. Here is an example of what i'm trying to do[code]....

View 1 Replies

Breakpoint Not Hit When Method Called In Lambda

Aug 2, 2011

When I put a breakpoint in a method I'm calling from a lambda expression, the breakpoint is never hit. When I move the method call outside the lambda, the breakpoint hits.

For example:

Function IncrementAll(ByVal items As IEnumerable(Of Integer)) As IEnumerable(Of Integer)
Return items.Select(Function(i) Increment(i))
End Function

[Code]....

If I call IncrementAll, the breakpoint in Increment does not get hit. Is there a way to make VS 2008 stop on these breakpoints? I hate the thought of rewriting all my LINQ into loops just for debugging.

View 1 Replies

Wpf - DependencyProperty Callback-Method Not Called

Nov 29, 2009

I create a UserControl (TableWithFilter.xaml) with a dependency property (source). The UserControl is a Table with a source property for the different items. I created the XAML and set the source property via the XAML Binding. So far so good.

But if the value of the dependency property is changed, the defined callback method is not called. Therefore I cannot update the entries in my table. Has anyone an idea why the callback method is not called?

Here is the definition of my property in the class "TableWithFilter":

Public Shared ReadOnly SourceProperty As DependencyProperty = _
DependencyProperty.Register("Source", GetType(List(Of TableViewItem)), GetType(TableWithFilter), _

[Code]....

If the attribute "ContentList" is changed I expet that the "ChangeSource" method in the TableWithFilder class is called. But this is not the case. After I changed the ContentList attribute, I Raise the following Event:

RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("ContentList"))

View 1 Replies

Dispose Method - Why Class Destructor Not Being Called

Jun 22, 2011

I have a class that has a destructor and a Dispose method (I also inherit IDisposable). Why is it that the only time my destructor gets called is when I call GC.Collect()?

View 2 Replies

Method To Be Called In Child Class Constructor

Nov 11, 2009

How do I force the Visual Studio compiler to generate an error when a required method is not being called in the constructor of a child class? Like when you edit the form designer code, the compiler complains when InitializeComponent()isn't the first call in the constructor of a form. Is this even possible in VB.NET?

View 2 Replies

Programatically Retrieve The Class That Called A Method?

Sep 11, 2010

I'm wondering if there's a way to programatically reference the class that called a method in another class. Let me give you an example:

Public Class OriginalClass
Private Sub Main()
Log.PgInit()

[Code]....

View 1 Replies

Write A Method That Is Called From A Variety Of Forms At Load?

Nov 29, 2010

I'm trying to write a method that is called from a variety of forms at load. So with a Form1 load event I would call the following:

Dim testpoint As New Point(10, 20)
DrawVerticalStringFromBottomUp("Hello", testpoint, Me)
The DrawVerticalSTringFromBottomUp Method is as follows:

[Code]....

When I call the code at a form's load event, nothing happens. When I call it from a button click after the form has loaded it works! I know this should be called from the paint method, but that doesn't suit my purposes.

way to make this work from the form load event?

View 4 Replies

Trying To Create A Stored Procedure Using The Nodes() Method Getting Syntax Error?

Aug 27, 2010

I am new to nodes() method. I am getting the foloowing syntax when trying to create a stored procedure using the nodes() method.

The syntax error:

Msg 170, Level 15, State 1, Procedure spmTestSelect, Line 19

Line 19: Incorrect syntax near '.'.

[code]...

View 2 Replies

VS 2008 Proper Syntax To Identify A Text Document For SAVEAS Method?

Dec 10, 2009

Using Excel Automation classes I am seeking to save an Excel file as a delimited text file. The examples given in the MSDN library refer to versions older than Express 2008 with (apparently) different syntax options for FileFormat.Based on the snippet shown, I get a COM exception error (800A03EC). Other variations produce the same error.

Am I improperly applying the Automation features?
Imports System.IO
Imports Microsoft.Office.Interop

[code]....

View 2 Replies

Made Called "ProdDet" And Jumps Out Of The Whole Method?

Jun 3, 2010

I am trying to learn how to create relations I got a sample from a web site and it works great, but when I tried to make one; it is not working. Can some one tell me what I am doing wrong. It gets down to the last relation that I made called "ProdDet" and jumps out of the whole method. The error message says the following:

System.ArgumentException: These columns don't currently have unique values.
at System.Data.ConstraintCollection.AddUniqueConstraint(UniqueConstraint constraint)
at System.Data.ConstraintCollection.Add(Constraint constraint, Boolean addUniqueWhenAddingForeign)
at System.Data.ConstraintCollection.Add(Constraint constraint, Boolean addUniqueWhenAddingForeign)

[Code]...

View 2 Replies

Have A Column In The Datatable Called Amount And A Textbox Acting As The Filter Called Say Maxamount To Set It?

Feb 9, 2011

i was wondering if it possible to have a condition where lets say you have a column in the datatable called amount and a textbox acting as the filter called say maxamount to set it so the rowfilter when filtering the table will sum the number in the amount column until the number in maxamount is met, then stop and only return the rows where the total sum of the amount column is equal or less than the maxamount value, so i guess if the next row takes us over the maxamount it discards this row and returns the rows previous to it. is this possible using datagridview rowfilter or should i be loooking elsewhere to achieve this?

View 4 Replies

Combo - Sql Table Called Stock With Two Fields Called StockID And StockCode

Jun 5, 2011

I have an sql table called Stock with two fields called StockID and StockCode. I want the user to select the stockcode from a combo which in turn populates the stockid for that item into a lable on my form. I have already populated the stockcode into the combo but dont know how to compelte the rest.

Imports System.Data.SqlClient

Public Class cbo2
Private Sub cbo2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[CODE]...

View 4 Replies

Form Called FrmPracDetails Which Is Built Up With A List View Called LvwColProc

Aug 11, 2009

I have a form called FrmPracDetails which is built up with a List view called LvwColProc. Therefore when you click a field on the LvwColProc it takes you to another form called FrmColProcessing, here you can make changes to certain fields which are also present on FrmPracDetails. What I want to do is when you make changes on FrmColProcesing and Click the Save Button (which calls the Save function)the changes appear instantly on FrmPracDetails. Please note, FrmColProcessing will always be open next to FrmPracDetails. I have tried to put this code in the Save function present in FrmCol Processing as shown below, but it doesnt Refresh FrmPracDetails form. [code]

View 1 Replies

Properties - Default Property Set Being Called Mysteriously Called?

Apr 2, 2012

I have the following line of code in my program:

JCL_History.Enqueue(JCL_History(I))


This JCL_History object is basically a Generic.List encapsulated in a wrapper and has the following method:

Public Sub Enqueue(ByRef value As String)
If Members.Contains(value) Then
Me.RemoveAt(Members.IndexOf(value))

[Code].....

In my testing I have 2 items in this JCL_History list. When I call that first line of code I posted (the one that invokes Enqueue) with I = 1 I expect the first item to be shuffled to the bottom and the second item to be shuffled to the top.

After the thread returns from Enqueue I notice that this is exactly what happens to my list, HOWEVER if I hit the "step_in" button after the execution of Enqueue I go into the Default Property's set method where Index = 1 and value = and it screws everything up, because the item that got shuffled to the end (index 1) gets overwritten by the item value shuffled to the top.

So basically the set method on the default property is getting called at what I think to be a completely ridiculous time. What gives? By the way I'm running VS2005 on XP.

View 1 Replies

.net - SSRS Report Called From ReportViewer Control Displays No Data In The Report When Called With A Parameter

Apr 11, 2012

Can you look at my coding and let me know what I'm missing or doing wrong?I have a SSRS report that is called from a ReportViewer control and the ProcessingMode for this control is Remote. The report also has 1 parameter in it's DataSet.In the code I placed a MsgBox to make sure the code is finding the parameter and returning the parameter name. I am trying to stick the value of 10 into the parameter for playerID 10. Data for this player does exist.

I believe I need to add some more code to make this work but I'm not sure what else to add.

When the code executes the report is displayed but no data is shown in the report.

[Code]...

View 1 Replies

Office Automation :: Called "Freemind" That Is Called A 'mind Mapping' Program?

May 13, 2010

I recently found an awesome tool called "Freemind" that is called a 'mind mapping' program. It's similar to MS Visio but way cooler and more automated.I reeeallly would like to integrate this into a VB.net Form, but how?

Has anyone seen or heard of mind mapping inside VB.net before? Are there programs out there already that work with VB.net or anyone have an example they have seen / built that works?

View 5 Replies

Strongly-typed Generic Method Invokes Its Argument's Base Class Method Instead Of A Shadowed Method In T?

Oct 19, 2010

Consider a MyForm class that contains a shadowed implementation of Show(). It also contains a CreateForm() method, which accepts an instance of the form and calls the shadowed sub:

[Code]....

View 3 Replies

Syntax/Command Trying To Implement Syntax Highlighting In RichTextBox?

Oct 12, 2011

I am having an issue trying to figure this out. I am writing a script editor that uses tabs (a tab control) and I want to implement syntax highlighting. My issue is that every sample I can find on syntax highlighting uses

Private Sub RichTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged

View 1 Replies

C# - Syntax Conversion - Translate Syntax ?

Dec 16, 2009

Can any one translate the following syntax to vb.net.

m_TextBox.Loaded += TextBoxLoaded
m_TextBox.Loaded -= TextBoxLoaded;
private void TextBoxLoaded(object sender, RoutedEventArgs e)[code].....

View 4 Replies

How To Verify If Value Actually Exists

Feb 10, 2011

I've created a little procedure that I use to verify if a value does actually exist. I'm currently using this all throughout my application for things such as verifying if a control's EditValue actually has a value. I was wondering if I have missed any scenarios where a value would not be available, missing, non-existent, blank, etc., and how would I incorporate in my procedure.

Public Function ValueExist(ByRef CheckValue As Object) As Boolean
Try
ValueExist = True
If IsDBNull(CheckValue) Then
ValueExist = False
[Code] .....

View 2 Replies

Verify First 3 Characters?

Mar 3, 2010

I am working on an app and cannot remember how to verify that the first three characters in a zip code are a specific number.

View 1 Replies

Adds A New Row From A Source Table Called "objTablaOrigen" To A Final Table Called "objTablaDestino"?

Feb 26, 2007

My code Adds a New Row from a Source Table called "objTablaOrigen" To a final table called "objTablaDestino". This tables are passed ByRef because they come from a DataSet respectively. objRowNuevo is The Row that will be added to "objTablaDestino" The data from "objRow" is well copied to the "objRowNuevo" (that is the new Row with type of objTablaDestino).

'The problem occurs when the instruction Add is executed. ¿What happens? The new row is added as well, but this generates an Exception with the next message:

[Code]...

View 1 Replies

.net - Verify User Log In Using LDAP?

Nov 17, 2011

I have not been able to successfully verify a user with LDAP for an ASP.NET web application. I have done so on our own network against Active Directory, but this is against a server outside of our network that is OID (Oracle Internet Directory).Usually, I use the following code with no problem.

Dim myDirectoryEntry As New System.DirectoryServices.DirectoryEntry("LDAP://1.2.3.4:999/OU=SomeOU,DC=Something,DC=com")
myDirectoryEntry.AuthenticationType = System.DirectoryServices.AuthenticationTypes.Sealing
myDirectoryEntry.AuthenticationType = System.DirectoryServices.AuthenticationTypes.Secure
Try

[Code]...

After that, I haven't been able to find a method to verify a user's log in information with their password and then pull back some information.

View 1 Replies

.Net Verify Joomla Password?

Sep 28, 2010

I know this is a stretch, but I am looking for some .NET help with checking Joomla passwords.For those not familiar with Joomla password scheme, it looks like this: {MD5Hash}:{SALT}HEre is the code I am using:Joomla password:

9322a02004887255b76a6a8e8971aea7:5JTTaPQjA88247nCKkTILtv8TXFtZCED
User submitted password: 123456
Dim m5t() As String = dr("password").split(":") // splict Joomla password

[code].....

View 1 Replies

Easiest Way To Verify If A Number Is Odd Or Even?

Jan 10, 2011

What is the easiest way to verify if a number is odd or even?I'm setting up a program, and it is checking if a user input number is even or odd, if its odd, it runs this, if even, it runs this.Its a simple if/then, else statement.

View 2 Replies







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