<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: souilmimohamed</title>
    <description>The latest articles on DEV Community by souilmimohamed (@souilmimohamed).</description>
    <link>https://dev.to/souilmimohamed</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1286020%2F34ce5d3e-0e70-4ad5-a8e7-be9e79fb0957.jpg</url>
      <title>DEV Community: souilmimohamed</title>
      <link>https://dev.to/souilmimohamed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/souilmimohamed"/>
    <language>en</language>
    <item>
      <title>Review the following question edit</title>
      <dc:creator>souilmimohamed</dc:creator>
      <pubDate>Tue, 20 Feb 2024 07:50:36 +0000</pubDate>
      <link>https://dev.to/souilmimohamed/review-the-following-question-edit-29np</link>
      <guid>https://dev.to/souilmimohamed/review-the-following-question-edit-29np</guid>
      <description>&lt;p&gt;when building a react native tv-os app using eas build -p android command i get this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Script '/home/expo/workingdir/build/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle' line: 377
* What went wrong:
A problem occurred evaluating project ':expo'.
&amp;gt; A problem occurred configuring project ':expo-av'.
   &amp;gt; [CXX1102] Location specified by ndk.dir (C://Users//souilmi//AppData//Local//Android//Sdk//ndk//25.1.8937393) did not contain a valid NDK and couldn't be used
* Try:
&amp;gt; Run with --stacktrace option to get the stack trace.
&amp;gt; Run with --info or --debug option to get more log output.
&amp;gt; Run with --scan to get full insights.
&amp;gt; Get more help at https://help.gradle.org.
==============================================================================
2: Task failed with an exception.
-----------
* Where:
Script '/home/expo/workingdir/build/node_modules/expo-modules-core/android/ExpoModulesCorePlugin.gradle' line: 65
* What went wrong:
A problem occurred configuring project ':expo'.
&amp;gt; Could not get unknown property 'release' for SoftwareComponent container of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
* Try:
&amp;gt; Run with --stacktrace option to get the stack trace.
&amp;gt; Run with --info or --debug option to get more log output.
&amp;gt; Run with --scan to get full insights.
&amp;gt; Get more help at https://help.gradle.org.
==============================================================================
BUILD FAILED in 2m 10s
10 actionable tasks: 10 executed

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the app builds fine in local and runs on an emulator these are my specs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Gradle 8.3.
Node v18.13.0
react-native-tvos V0.73.2-0
Expo V50.0.4

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;what i'm i doing wrong?&lt;/p&gt;

</description>
      <category>reactnative</category>
    </item>
    <item>
      <title>getting errors when building react-native-tvos app</title>
      <dc:creator>souilmimohamed</dc:creator>
      <pubDate>Tue, 20 Feb 2024 07:48:47 +0000</pubDate>
      <link>https://dev.to/souilmimohamed/getting-errors-when-building-react-native-tvos-app-4f6n</link>
      <guid>https://dev.to/souilmimohamed/getting-errors-when-building-react-native-tvos-app-4f6n</guid>
      <description>&lt;p&gt;when building a react native tv-os app using eas build -p android command i get this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Script '/home/expo/workingdir/build/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle' line: 377
* What went wrong:
A problem occurred evaluating project ':expo'.
&amp;gt; A problem occurred configuring project ':expo-av'.
   &amp;gt; [CXX1102] Location specified by ndk.dir (C://Users//souilmi//AppData//Local//Android//Sdk//ndk//25.1.8937393) did not contain a valid NDK and couldn't be used
* Try:
&amp;gt; Run with --stacktrace option to get the stack trace.
&amp;gt; Run with --info or --debug option to get more log output.
&amp;gt; Run with --scan to get full insights.
&amp;gt; Get more help at https://help.gradle.org.
==============================================================================
2: Task failed with an exception.
-----------
* Where:
Script '/home/expo/workingdir/build/node_modules/expo-modules-core/android/ExpoModulesCorePlugin.gradle' line: 65
* What went wrong:
A problem occurred configuring project ':expo'.
&amp;gt; Could not get unknown property 'release' for SoftwareComponent container of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
* Try:
&amp;gt; Run with --stacktrace option to get the stack trace.
&amp;gt; Run with --info or --debug option to get more log output.
&amp;gt; Run with --scan to get full insights.
&amp;gt; Get more help at https://help.gradle.org.
==============================================================================
BUILD FAILED in 2m 10s
10 actionable tasks: 10 executed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the app builds fine in local and runs on an emulator these are my specs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Gradle 8.3.
Node v18.13.0
react-native-tvos V0.73.2-0
Expo V50.0.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;what i'm i doing wrong?&lt;/p&gt;

</description>
      <category>android</category>
      <category>reactnative</category>
      <category>gradle</category>
    </item>
    <item>
      <title>C# Xunit Unit testing Withwith Dependency Injection</title>
      <dc:creator>souilmimohamed</dc:creator>
      <pubDate>Tue, 20 Feb 2024 07:40:02 +0000</pubDate>
      <link>https://dev.to/souilmimohamed/c-xunit-unit-testing-withwith-dependency-injection-57e7</link>
      <guid>https://dev.to/souilmimohamed/c-xunit-unit-testing-withwith-dependency-injection-57e7</guid>
      <description>&lt;p&gt;in A dote net core 6 API project, i use Xunit for unit testing, i'm trying to test a method inside a service ICrpForcastsService that i implement in a partial class CrpForcastsService&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ForcastTester: IClassFixture&amp;lt;InjectionFixture&amp;gt;
{
    private readonly InjectionFixture injection;
    private readonly Psz.Core.Identity.Models.UserModel _user;
    private readonly ICrpForcastsService _crpForcastsService;
    public ForcastTester(InjectionFixture injection, ICrpForcastsService crpForcastsService)
    {
        this.injection = injection;
        var helpers = new TestingHelpers();
        _user = helpers.GetDefaultTestUser();
        _crpForcastsService = crpForcastsService;
    }
    [Fact]
    public void TestGetForecasts()
    {
        #region Arrange
        var expected = typeof(Psz.Core.Common.Models.ResponseModel&amp;lt;IEnumerable&amp;lt;Psz.Core.CRP.Models.Forcasts.ForcastHeaderModel&amp;gt;&amp;gt;);
        #endregion
        #region Act
        var result = _crpForcastsService.GetForcasts(_user);
        #endregion
        #region Assert
        Assert.NotNull(result);
        Assert.NotNull(result.Body);
        Assert.True(result.Success);
        Assert.IsType(expected, result);
        Assert.True(result.Body.Count() &amp;gt; 0);
        #endregion
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and i made a fixture class to initiate the startup with a test server like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class InjectionFixture
{
    public readonly TestServer server;
    private readonly HttpClient client;

    public InjectionFixture()
    {
        server = new TestServer(new WebHostBuilder().UseStartup&amp;lt;Startup&amp;gt;());
        client = server.CreateClient();
    }
    public IServiceProvider ServiceProvider =&amp;gt; server.Host.Services;

    public void Dispose()
    {
        Dispose(true);
    }
    protected virtual void Dispose(bool disposing)
    {
        if(disposing)
        {
            server.Dispose();
            client.Dispose();
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the Startup class where i set the webHsotBuilder and add the service that i'm testting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Startup
{
    public Startup()
    {
        var builder = new ConfigurationBuilder()
            .SetBasePath(Directory.GetCurrentDirectory())
            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
            .AddEnvironmentVariables();
        Configuration = builder.Build();
    }
    public IConfigurationRoot Configuration { get; }
    public virtual void ConfigureServices(IServiceCollection services)
    {
        services.AddScoped&amp;lt;ICrpForcastsService, CrpForcastsService&amp;gt;();
        services.AddControllers();
    }
    public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;when i rn the test i get this Error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(No service for type 'Microsoft.AspNetCore.Builder.IApplicationBuilder' has been registered.) (The following constructor parameters did not have matching fixture data: ICrpForcastsService crpForcastsService)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;what i'm i missing ??&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>unittest</category>
      <category>xunit</category>
    </item>
  </channel>
</rss>
