struct Test {
const int t = 42;
};
template <class T>
struct TestTemplateThis : T {
int get_t() const { return this->t; }
};
template <class T>
struct TestTemplateNoThis : T {
int get_t() const { return t; }
};
Describe(SomeTests) {
It(should_work_ok) {
Assert::That(TestTemplateThis<Test>{}.get_t(), Equals(42));
}
It(should_work_ok_too) {
Assert::That(TestTemplateNoThis<Test>{}.get_t(), Equals(42));
}
};
namespace Test { public class Test { public string a, b; public bool DummyMethod() { string local_b, local_a = default; local_b = null; return local_a == local_b; } } }
- namespace Test {
- public class Test {
public string a,b = null;- public string a, b;
public bool DummyMethod() {- public bool DummyMethod()
- {
- string local_b, local_a = default;
- local_b = null;
- return local_a == local_b;
- }
- }
- }
namespace Solution { using NUnit.Framework; using System; using Test; [TestFixture] public class SolutionTest { [Test] public void MyTest() { var test = new Test(); Assert.AreEqual(test.a, test.b); Assert.True(test.DummyMethod()); } } }
- namespace Solution {
- using NUnit.Framework;
- using System;
- using Test;
- [TestFixture]
- public class SolutionTest
- {
- [Test]
- public void MyTest()
- {
- var test = new Test();
- Assert.AreEqual(test.a, test.b);
- Assert.True(test.DummyMethod());
- }
- }
- }
namespace Test {
public class Test {
public string a;
public string b = null;
}
}
namespace Solution {
using NUnit.Framework;
using System;
using Test;
[TestFixture]
public class SolutionTest
{
[Test]
public void MyTest()
{
var test = new Test();
Assert.AreEqual(test.a, test.b);
}
}
}