public class Kumite { public static bool ContainsNumber3(int x) => x.ToString().Contains('3'); }
- public class Kumite {
public static bool IsThree(int x) =>- public static bool ContainsNumber3(int x) =>
- x.ToString().Contains('3');
- }
using NUnit.Framework; namespace Tests { [TestFixture] class TestsClass { [Test] public void Tests() { Assert.IsFalse(Kumite.ContainsNumber3(525458)); Assert.IsFalse(Kumite.ContainsNumber3(2222)); Assert.IsTrue(Kumite.ContainsNumber3(354523)); Assert.IsTrue(Kumite.ContainsNumber3(748504231)); } } }
- using NUnit.Framework;
- namespace Tests {
- [TestFixture]
- class TestsClass {
- [Test]
- public void Tests() {
Assert.IsFalse(Kumite.IsThree(525458));Assert.IsFalse(Kumite.IsThree(2222));- Assert.IsFalse(Kumite.ContainsNumber3(525458));
- Assert.IsFalse(Kumite.ContainsNumber3(2222));
Assert.IsTrue(Kumite.IsThree(354523));Assert.IsTrue(Kumite.IsThree(748504231));- Assert.IsTrue(Kumite.ContainsNumber3(354523));
- Assert.IsTrue(Kumite.ContainsNumber3(748504231));
- }
- }
- }