Error trying to run Unit Test or process

I tried to check my code using unified test. I dont know if that's the name for this process. In spanish is "Pruebas Unitarias" but I dont get the correct translation.
Im using nunit to check my code.
The error I've is:

Cannot implicitly convert type 'Esabe.Grazalema.Business.Appliances.IDS' to 'string'

Check My code pls.

Thanks for any help
// This is the code in my "Unified test" and the error is in the string id....... line
    
[Test]
    public void InsertNew2()
    {
        Appliances am = new Appliances();
        string id = am.Insert2("BP-BCNSAV", 5131, "0006B12D2D98", true, "severN_prueba");
        Assert.AreNotEqual(0, id, "El id de la alerta insertada no es válido");
    }
 
//I invoke this method:
 
public IDS Insert2(string name, int companyId, string serialNumber, bool applianceCRM, string severName)
 
{
    // Some functions
}

Open in new window

LVL 5
nkoriginalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
You are trying to assign a type of IDS to a string type variable in line 7. Change "string id" to "IDS id". Then, in line 8, do something like (pick whichever id you are working with):
Assert.AreNotEqual(0, id.appID, "El id de la alerta insertada no es válido");
 
// or //
 
Assert.AreNotEqual(0, id.coID, "El id de la alerta insertada no es válido");

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nkoriginalAuthor Commented:
I tried to change to IDS id, but I cannot found the IDS method.
I've a separate page to check the code, so when I called the IDS, it said: The type or namespace name IDS could not be found( are you missing a using directive or an assembly reference)

i clean my solution and I rebuild it.
0
käµfm³d 👽Commented:
If this is a part of the same project as the original code for IDS, then as long as you declared it "public," you should be able to access it from here. If it is a different project, then it may be just as easy to copy the definition of IDS to this project. Just paste the struct definition outside of this class, but within the namespace and you should be fine.
namespace SomeNamespace
{
    public class InitialClass
    {
        // some stuff
    }
 
    // Paste here
    public struct IDS
    {
        public int appID;
        public int coID;
    }
}

Open in new window

0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

nkoriginalAuthor Commented:
I dont know how to say THANK YOU. You help me a lot with a project at my work.
I really appreciate your help.

I need one more help, with the code you send me, is something about the exception (I promise is my last question). i will open the question, if you could help me I will really appreciate it, if not, thanks any way.
0
nkoriginalAuthor Commented:
Amazing Help. thank u very much!! :D:D
0
nkoriginalAuthor Commented:
Kaufmed, here is the link if you can help me with the exception I need in my code. Is inside the code you gave me in other question i made.

http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_24436663.html

thanks again!
:)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Software

From novice to tech pro — start learning today.