<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unit Testing Asp.NET Core 2.0 Web API in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unit-Testing-Asp-NET-Core-2-0-Web-API/m-p/76183#M47571</link>
    <description>&lt;DIV class="_3xX726aBn29LDbsDtzr_6E _1Ap4F5maDtT1E1YuCiaO0r D3IL3FD0RFy_mkKLPwL4"&gt;&lt;DIV class="_292iotee39Lmt0MkQZ2hPV RichTextJSON-root"&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;I am having quite the week writing tests for a Web API. I'm using Moq and Xunit. I'm very simply trying to write unit tests for my controllers. I may be over-thinking this whole process because it seems as though it should be pretty straightforward.&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Each of my controllers have constructors injected with UserManager&amp;lt;ApplicationUser&amp;gt;. So when I go to write tests, do I need to make a mock of the specific controller and then make a mock of the services injected into that controller? Does anyone have some good examples? I can't seem to find a clear solution on StackOverFlow.&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Thanks!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 06 May 2021 19:11:39 GMT</pubDate>
    <dc:creator>PristoMiky</dc:creator>
    <dc:date>2021-05-06T19:11:39Z</dc:date>
    <item>
      <title>Unit Testing Asp.NET Core 2.0 Web API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unit-Testing-Asp-NET-Core-2-0-Web-API/m-p/76183#M47571</link>
      <description>&lt;DIV class="_3xX726aBn29LDbsDtzr_6E _1Ap4F5maDtT1E1YuCiaO0r D3IL3FD0RFy_mkKLPwL4"&gt;&lt;DIV class="_292iotee39Lmt0MkQZ2hPV RichTextJSON-root"&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;I am having quite the week writing tests for a Web API. I'm using Moq and Xunit. I'm very simply trying to write unit tests for my controllers. I may be over-thinking this whole process because it seems as though it should be pretty straightforward.&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Each of my controllers have constructors injected with UserManager&amp;lt;ApplicationUser&amp;gt;. So when I go to write tests, do I need to make a mock of the specific controller and then make a mock of the services injected into that controller? Does anyone have some good examples? I can't seem to find a clear solution on StackOverFlow.&lt;/P&gt;&lt;P class="_1qeIAgB0cPwnLhDF9XSiJM"&gt;Thanks!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 May 2021 19:11:39 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unit-Testing-Asp-NET-Core-2-0-Web-API/m-p/76183#M47571</guid>
      <dc:creator>PristoMiky</dc:creator>
      <dc:date>2021-05-06T19:11:39Z</dc:date>
    </item>
  </channel>
</rss>

