-3

I need to write a test case for functions that do simple math problems. One of the test cases is having no inputs or empty inputs. I've tried most things but none seem to work. This is the format of the test case:

// copy ; x, y, length ; expected y

duplicus ; () , () , 0 ; 0 // empty

duplicus ; " , " , 0 ; 0 // empty

duplicus ; , , 0 ; 0 // empty

duplicus ;  ,  , 0 ; 0 // empty

duplicus ; -1 , -1 , 0 ; 0 // empty
iBreakiOS
  • 31
  • 7
Amin
  • 1
  • 5
    `"I've tried most things but none seem to work"` -- I dont see any code at all, you need to include a [MCVE] with your question – maccettura Sep 19 '19 at 17:44
  • I don't understand what those formats are supposed to represent either. It looks like they're supposed to be C#-esque, but again, without seeing what code you have, it's pretty much impossible to help you. – Broots Waymb Sep 19 '19 at 17:50
  • Is there a question? – NetMage Sep 19 '19 at 17:57
  • This is a homework problem, the code is hypothetical and I don't have access to it. But it is inputting x,y, and length (length of x and y) as integers and outputting y replaced with x. I don't need any help with the code itself I just need to know what an empty integer input looks like in c so I can place it in the test case. – Amin Sep 19 '19 at 18:12
  • format is: function ; input vector, input vector, input vector ; output – Amin Sep 19 '19 at 18:13
  • What do you mean by "empty integer input"? Unless you're talking about a nullable int (`int?`), this doesn't make sense to me. You also mention `c` in your comment, but this question is tagged as `c#`. Which is correct? – Broots Waymb Sep 19 '19 at 18:17

1 Answers1

0

Unfortunately, you have not provided enough information for us to understand what you really need. No input usually means passing a null. For example, if you have a TextBox1 and its .Text is not modified in any way by you or the user, but you pass the content of it to a variable, it will contain nothing, it will be a null.

Now, the format you provided doesn't ring a bell, but, if you want to pass a null or you want to have an "empty" variable to work with, you can just declare it as a Nullable-int.

By default, .NET doesn't allow you to set an int to null, so you need to make it Nullable like this:

int? yourName = 0;

This variable is now a NULL you can pass to test cases, but again, I don't understand what you need because of the lack of info. Please provide more info/code.

iBreakiOS
  • 31
  • 7