vendredi 27 novembre 2020

i can get my code to work with my test program

using System;

namespace ITSS131
{
public class Program
{
    public static void Main(string[] args)
    {

        Console.WriteLine("Enter a number between 0 and 10:");

        string v = (Console.ReadLine());
        int g = int.Parse(v);
        int o = 0;
        int p = 10;


         GetNumber(0, 10);

        Console.WriteLine(v);
    }


    public static void GetNumber(int num01, int num02)
    {
        string t = Console.ReadLine();

        int y = int.Parse(t);

        Console.WriteLine(y);

//This is the test it should come out as false but it doesn't work at all and i don't know why.

    {public void AllowsNegativeNumbersWhenLowerLimitDecreased()
    {
        this.SetUpInput(-5);

        var result = Program.GetNumber(-100,
                                       100);

        Assert.AreEqual(-5,
                        result,
                        "-5 is between -100 and 100 and should be valid");

// i have tried to change it to change it but it comes out the same error

Aucun commentaire:

Enregistrer un commentaire