here is the description of the 3 offers
ESSENTIAL : just one device
STANDARD : HD and 2 devices
PREMIUM : UltraHD and 4 devices
Write the code that returns the right offer
using System;
public class Kata
{
public static string GetContract( int numberOfDevices, bool ultraHd, bool hd)
{
string result = "ESSENTIEL";
if (numberOfDevices>2 || ultraHd)
{
result = "PREMIUM";
}
else
{
if (numberOfDevices == 2 || hd)
{
result = "STANDARD";
}
}
return result;
}
}
namespace Solution {
using NUnit.Framework;
using System;
// TODO: Replace examples and use TDD development by writing your own tests
[TestFixture]
public class SolutionTest
{
[Test]
public void TestMethodGetContract4()
{
var actual = Kata.GetContract(4, false, false);
var expected = "PREMIUM";
Assert.AreEqual(expected, actual);
}
[Test]
public void TestMethodGetContract2()
{
var actual = Kata.GetContract(2, false, false);
var expected = "STANDARD";
Assert.AreEqual(expected, actual);
}
[Test]
public void TestMethodGetContract1()
{
var actual = Kata.GetContract(1, false, false);
var expected = "ESSENTIEL";
Assert.AreEqual(expected, actual);
}
[Test]
public void TestMethodGetContractUltraHD()
{
var actual = Kata.GetContract(1, true, false);
var expected = "PREMIUM";
Assert.AreEqual(expected, actual);
}
[Test]
public void TestMethodGetContractHD()
{
var actual = Kata.GetContract(1, false, true);
var expected = "STANDARD";
Assert.AreEqual(expected, actual);
}
}
}