Use Imaginary Unit In Program?
Apr 14, 2010
I want to know is their a way to display the imaginary unit i. For example when I calculate the square root of -25, I want the program to display the answer 5i instead of NaN (Not a Number). So is their a way to display imaginary numbers and even complex numbers in visual basic 2008.
View 8 Replies
ADVERTISEMENT
Apr 1, 2010
anyone have experience doing this? when i say imaginary i mean the square root of negative one. how would i graph this?
View 2 Replies
Jul 21, 2010
I have written one application which communicate with one data logger unit (temperature monitoring unit) and download records after some interval. Unit continuously send current temperature which I have to show on screen and after each one hour I have to download log (all records saved inside unit at max 1024) from unit.
Now problem is after downloading log, application get hang or what we called working in background and resume after some time. If I pause debugger in visual studio 2008 it show control at application start (sub main) with message as "application will resume here after completing execution of current function". There is nothing in output window. So how can i trace is there any events got spool or what actually application doing in background.
View 1 Replies
Apr 12, 2011
Does anyone have a nice sample of a unit convertor handling multiple unit types that I can integrate in my application? I have found this one, but it is only handling one type of unit. For example I want to convert weight as well as volume from and to imperial units.
View 8 Replies
Jun 18, 2012
Im trying to make a program which basically performs unit conversion. I have basically made two text boxes, one for the S.I. Units and the other for British Units. The general idea is that when i input any number in the S.I. Unit text box, it should display the answer in British Unit text Box and similiarly if i input any number in British Unit Textbox, the answer should be displayed in S.I.Unit textbox. Now the problem lies here that the code that i created is by using if else. now the compiler automatically gives me the correct result in the British box when i input the value in the s.i. unit box, but when i input the value in the british text box, it gives an error that :
"An unhandled exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
Additional information: Conversion from string "" to type 'Double' is not valid."
Heres the part of the code.
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim p As String = "Pressure"
[Code].....
View 4 Replies
Mar 15, 2009
As I develop code, I often want to unit test some of the building blocks of a class even if they are normally private. If my unit tests are inside the project, I can use "Friend" to accomplish this and still keep the functions private for normal use. But I would rather move my NUnit tests into their own separate project(s).
View 3 Replies
Jan 16, 2010
What code can you use to get the unit in a currency?
For example in 10,340.55 there is:
10 units for a thousand.
3 units for hundreds
4 units of tens.
1 fifty cent
1 five cent.
View 4 Replies
Apr 18, 2012
I tried to make an unit test for this method which is pretty simple only add an object into the data base and if it works well returns true
[Code]...
View 1 Replies
Dec 29, 2010
I have been assigned a task of exploring unit testing using tools available in the market.My question is how do i write an API that would help in writing unit test cases.Example i can use nunit to write something like this to check whether file exists in the given location.
<Test()> _
Public Sub CheckOutputFileInfo()
ReportPath = "D:temp est.txt"
[code].....
View 3 Replies
Feb 3, 2011
So when that code run the program don't switch.Say I want to
Open a file
Write something
Close a file
Way when I open a file, another thread want to open that same file. That means open a file get executed twice.
View 4 Replies
Aug 27, 2009
When i perform unit testing on routines, using the unit testing framwork provided by VSTS, i need to get a output of the unit test and result on to a document (documentation). how do i do i do this?
View 1 Replies
Apr 10, 2012
I want to create a logic to calculate the age and unit from entered birth date. eg: If the difference between birth date and current date is >= 24 months, I will want it to display the age in years. If >= 8 weeks, I will want it to display it in months and so on here's my code
[Code].....
View 9 Replies
Jul 9, 2010
How do I go about rounding up to the nearest (Unit 10) ie Codes Below
IfVal(TimeHalfFareTextBox.Text = $/£ 0.05)
Then roundup
to $/£ 0.10. Or it might be .....
[Code]....
View 6 Replies
Aug 29, 2009
In the project that i;m currently working on i;m not allowed to touch GUI for anyreason that includes program testing. I'm in bit of s frustration becuase prior to this all must application were developed and tested using GUI. Typicvally it wold take a me a week to develop an app now it taking more than that. Especially the TDD with Unit testing. The documentation kills more time too......
View 4 Replies
Apr 28, 2009
I really like the moq mocking framework. I've used it on several projects. Unfortunately, one of my customers is demanding we use VB.Net. Not my preference, but hey, .Net is .Net, right?I've heard that moq has some trouble with VB. Is this true? Is so, what sorts of trouble? I would expect it to work fine given the language agnostic nature of .Net.
Should I look into using some other mocking framework for use with VB?
View 2 Replies
Sep 1, 2011
I have a unit test project and a project A that refers to the dll B. When make changes to the dll B and build my solution again I get an error meassage: could not load dll B or one of it's dependencies when i try to run the test project. The dll B does not exists in the references of the test project.
View 11 Replies
Sep 10, 2009
I created some string resources in My.Resources. I want to use those resources in my unit tests.How do I expose these resources to my unit test project?I tried simply setting the Access Modifier to "Public" for the resources. This made it so that I can compile the code, but it is ignoring the culture setting.
Bo.My.Resources.Culture = New CultureInfo("en-GB", False)
LocaleTest(Bo.My.Resources.Yes, "Yea")
View 2 Replies
Mar 3, 2010
I am writing a test unit (in MSTest) that consumes an XML file located in the testing project. I have this (solution name is BusinessLogic, project name is BusinessLogicTest):
Public TestContext As TestContext
<TestMethod()>
<DeploymentItem("BusinessLogic.BusinessLogicTestTestData.xml")>
<DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML",
"|DataDirectory|TestData.xml", "Row", DataAccessMethod.Sequential)> _
Public Sub ConvertIntToRoman_DataDrivenTest
[Code] .....
However, when I run the test I get an error: The unit test adapter failed to connect to the data source or to read the data. I belive it's something to do with my DeploymentItem and/or DataSource, however, I cannot find an example (in VB) that works anywhere.
View 2 Replies
Sep 18, 2011
Doing some homework on unit testing and in all honestly i just don't get why i get this error.
i got a simple method that select all text when tab and testing if the actually textbox1 is selected. I just don't get why i'm getting a nullReferenceException at target.txtbox1_Enter(sender, e)
Private Sub txtbox1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtbox1.enter
Dim txtBox As TextBox
[Code].....
View 1 Replies
Apr 18, 2011
I've read about creating factories, and unit testing driven development and how it actually saves you time during the debug phase of development. I'm using some libraries for an entity framework (Entity Spaces, since we are not on dot-net 4.0 yet)
Since getting started seems to be the hardest part for me to wrap my brain around, How would I create a factory for an object that is unit testable on a simple method like so?
[Code]...
However when I call video, its giving me "possible null reference exceptions" errors, and indeed its throwing a null reference. If my constructor is declared public and shared, and is creating a new object, then returning it, why is it giving me null exceptions?
View 1 Replies
Apr 1, 2011
I'm wanting to create a load of unit tests to make sure my stored procedures are working, but i'm failing (i'm new to tests in visual studio).Basically I want to do the following:
<testclass()>
Dim myglobalvariable as integer
<testmethod()>
[code]....
The problem is because the tests don't run sequentially, tests 2 and 3 fail because the global variable isn't set.
View 4 Replies
May 4, 2009
Can anyone point me towards a complete scenario using MSTest,vb.net, with or without mocks,MVP (supervising controller)
View 1 Replies
Jan 26, 2010
I receive a decimal number with a maximum of 4 digits after the "." and I know this number is in milligram.
I have to find the best matching unit (milligram, gram, kilogram) for the number.
for an example if I receive
edited
116000000.0000 milligram, it's going to return 116.0000 kilogram
66990000.0000 milligram, it's going to return 66.9900 kilogram
49000010.0000 milligram, it's going to return 49000.0100 g
[Code]....
View 6 Replies
Oct 13, 2011
how to convert a metric unit to standard. I will be converting Feet/Inches to Meters/Centimeters and vise versa as well as pounds/ounces to kilograms/grams and vise versa. I can input the values into my Textbox to where it reads " x'y" ," however, when I go to code the Convert button (the same button has to be used for all conversions) how to separate out the text and then perform the conversion.
View 7 Replies
Oct 5, 2010
Is there currently any possible way to report progress of my unit test? I have a test that could take up to a hour, and I don't want to sit there not knowing what % it is done with. I have tried writing with debug.print and trace.writeline, neither of which seem to work.
View 1 Replies
Apr 12, 2011
I want to include an optional parameter in a function statement that is of the type Unit. For example:
Public Shared Function NewTable(Optional ByVal TableWidth As Unit) As Table
Optional parameters require a default value, but I cannot figure out how to set a default value for a Unit type.
View 7 Replies
Jun 11, 2010
I would like to prevent all subsequent unit tests from running when certain conditions are met in a unit test. Is this possible in Visual Studio 2005?
View 2 Replies
Jun 3, 2009
I am having a problem with a unit test I have created. First time doing this so I am not sure why I am getting this error [code]Test method ETDS_Unit_Tests.LoginTest.ValidateUserNameTest threw exception: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server).This is the same connection that my software is using, and the software runs fine, only the unit test is failing. What I am doing wrong? It Seems to fail one time for each datarow in the table.Also, I am using a Linq Query in the method that I being tested. I believe that this may be what is causing my error.
View 2 Replies
Mar 12, 2009
I have a constructor that looks like this:
Public Sub New()
MyBase.New()
ws.Url = My.Settings.WebServiceURL
End Sub
(ws is private)
Is there any point in unit testing this?
The class did not previously have this constructor.
View 1 Replies
Mar 24, 2010
Usually when you add one (in Visual Basic), it pops up a message asking if you want to enable an option that lets the test access things like private methods etc.
However, I am editing a solution that does not have this enabled. I'd like to enable it so my unit tests will work, but I can't find the setting.
Can anyone tell me how to enable it after the project has been created?
View 1 Replies