Click here to Skip to main content
15,885,216 members
Articles / Programming Languages / C# 4.0

Universal Type Extender

Rate me:
Please Sign up or sign in to vote.
4.83/5 (30 votes)
5 Jun 2013Ms-PL11 min read 72.7K   569   62  
Emulate extension properties by extending any reference type with any other type.
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TB.ComponentModel.Infrastructure;

namespace UniversalTypeExtender.Tests.Infrastructure {
    [TestClass]
    public class ExtensionRepository_Tests {

        private ExtensionRepository mRepository;

        [TestInitialize]
        public void Initialize() {
            mRepository = new ExtensionRepository();
        }

        [TestMethod]
        public void Count_ShouldBe0() {
            mRepository.Count.Should().Be(0);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Software Developer
Germany Germany
--------------------------------
Thank you for voting
Best "Everything Else" Article
of September 2014

Comments and Discussions