17

これは私のdadクラスです

 public class Dad
    {
        public string Name
        {
            get;set;
        }
        public Dad(string name)
        {
            Name = name;
        }
    }

これが私のテスト方法です

public void TestDad()
        {
           UnityContainer DadContainer= new UnityContainer();
           Dad newdad = DadContainer.Resolve<Dad>();    
           newdad.Name = "chris";    
           Assert.AreEqual(newdad.Name,"chris");                 
        }

これは私が得ているエラーです

"InvalidOperationException - the type String cannot be constructed.
 You must configure the container to supply this value"

DadContainerこのアサーションが通過するように構成するにはどうすればよいですか? ありがとうございました

4

1 に答える 1