title: Why do I need to write initializer for struct in Swift in order to use it in unit tests?
body: <p>I am trying to use a public struct</p>
  
  <pre><code>public struct Person {
    public let name: String
  }
  </code></pre>
  
  <p>in a unit test (XCTest):</p>
  
  <pre><code>let person = Person(name: "Paul")
  </code></pre>
  
  <p>Test build fails with error:</p>
  
  <blockquote>
    <p>'Person' cannot be constructed because it has no accessible initializers.</p>
  </blockquote>
  
  <p>In order to build the test I need to write an initializer for the struct. Does not feel right because structs already have initializers. Does anyone have a better solution?</p>
  
  <p>Xcode version 6.1.1 (6A2008a)</p>