public void CanOverrideTwoInterfaceWhereItsTheSecond() { var data = @"tes test test public class TestAbc : IOther, IWhatever { }"; var replaced = new CSharpInterfaceReplacer().ReplaceHide(data, "IWhatever", "IService"); replaced.Should().Be(@"tes test test public class TestAbc : IOther, IService<IWhatever> { }"); }
public void CanOverrideOnlyOneInterface() { var data = @"tes test test public class TestAbc : IWhatever { }"; var replaced = new CSharpInterfaceReplacer().ReplaceHide(data, "IWhatever", "IService"); replaced.Should().Be(@"tes test test public class TestAbc : IService<IWhatever> { }"); }
public void WillNotOverrideIfAlreadyOverriden() { var data = @"tes test test public class TestAbc : IOther, IService<IWhatever>, IMustRemain { }"; var replaced = new CSharpInterfaceReplacer().ReplaceHide(data, "IWhatever", "IService"); replaced.Should().Be(@"tes test test public class TestAbc : IOther, IService<IWhatever>, IMustRemain { }"); }
public void CanUnOverrideThreeInterfaceWhereItsTheSecond() { var data = @"tes test test public class TestAbc : IOther, IService<IWhatever>, IService<IMustRemain> { }"; var replaced = new CSharpInterfaceReplacer().ReplaceShow(data, "IService"); replaced.Should().Be(@"tes test test public class TestAbc : IOther, IWhatever, IMustRemain { }"); }