<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>griefworker</author_name>
  <author_url>https://blog.hatena.ne.jp/griefworker/</author_url>
  <blog_title>present</blog_title>
  <blog_url>https://tnakamura.hatenablog.com/</blog_url>
  <categories>
    <anon>C#</anon>
  </categories>
  <description>素人が購入することは考えにくい Visual Studio 2010*1で、クラス内部で使っている他のクラスを無理やりモックに差し替え可能にする C# サンプルコードを書いてみた。 public class Foo { public Foo() { // デフォルトを設定 CreateBar = () =&gt; { return new BarProxy(new Bar()); }; } // 生成するインスタンスを差し替え可能にする internal Func&lt;IBarProxy&gt; CreateBar { get;set; } // 使うメソッドだけを抽出したインタフェースを定義 interna…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftnakamura.hatenablog.com%2Fentry%2F2012%2F10%2F19%2F190705&quot; title=&quot;内部で使っているクラスを無理やりモックと差し替え可能にする方法 - present&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-10-19 19:07:05</published>
  <title>内部で使っているクラスを無理やりモックと差し替え可能にする方法</title>
  <type>rich</type>
  <url>https://tnakamura.hatenablog.com/entry/2012/10/19/190705</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
