title: how to write angular unit test cases with set @Input and mock it?
body: <p>I'm new to Angular and currently learning to write the testcases. How should I write unit test cases for the following in angular/TypeScript?</p>
  <pre><code>@Input() set myOutputData(res: any) {
          this.apiError = '';
          if (!res) {
              this.myTableData = {
                  opt: [],
                  firstSummary: { netSummary: [], new_summary: '' },
                  secondSummary: { netSummary: [], new_summary: '' },
                  cost: 0
              };
              return;
          } else if (res &amp;&amp; Object.keys(res).length === 0) {
              this.myTableData = {
                  opt: [],
                  firstSummary: { netSummary: [], new_summary: '' },
                  secondSummary: { netSummary: [], new_summary: '' },
                  cost: 0
              };
              return;
          } else if (this.errorTable) {
              const msg = 'message';
              this.apiError = this.errorTable;
              this.localError = this.apiError;
              this.myTableData = {
                  opt: [],
                  firstSummary: { netSummary: [], new_summary: '' },
                  secondSummary: { netSummary: [], new_summary: '' },
                  cost: 0
              };
              return;
          } else {
              this.myTableData = res;
          }
  }
  </code></pre>