Skip to content

Commit

Permalink
Fixed tests and .net version
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-brutsky committed Aug 27, 2022
1 parent e4dc8a7 commit 5922f64
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 5 additions & 2 deletions MiHomeLib/MiHomeLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Title>MiHomeLib</Title>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net471</TargetFrameworks>
<PackageId>MiHomeLib</PackageId>
<PackageVersion>1.0.15</PackageVersion>
<MinClientVersion>2.6</MinClientVersion>
Expand Down Expand Up @@ -34,10 +34,13 @@ Check the details in the documentation.
<LangVersion>default</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.0.0" />
<PackageReference Include="newtonsoft.json" Version="13.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.0.0" />
</ItemGroup>

<ItemGroup>
<None Remove="Microsoft.Extensions.Logging.Console" />
</ItemGroup>
<ItemGroup>
<None Include="gateway.jpeg" Pack="true" PackagePath="\" />
<Folder Include="Miio\" />
Expand Down
5 changes: 4 additions & 1 deletion MiHomeUnitTests/Devices/SockerPlugTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using MiHomeLib;
using MiHomeLib.Commands;
using MiHomeLib.Contracts;
Expand All @@ -15,6 +17,7 @@ public class SockerPlugTests : IClassFixture<MiHomeDeviceFactoryFixture>

public SockerPlugTests(MiHomeDeviceFactoryFixture deviceFactory)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
_deviceFactory = deviceFactory;
}

Expand Down Expand Up @@ -100,4 +103,4 @@ public void Check_SocketPlug_TurnOff_Command()
It.Is<SocketPlugCommand>(c => c.ToString() == command)), Times.Once());
}
}
}
}
6 changes: 5 additions & 1 deletion MiHomeUnitTests/Miio/MiRobotV1Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using MiHomeLib.Devices;
using Moq;
using Xunit;
using System.Threading;
using System.Globalization;

namespace MiHomeUnitTests
{
Expand All @@ -10,6 +12,8 @@ public class MiRobotV1Tests: MiioDeviceTest
[Fact]
public void ToString_Returns_Valid_State()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

// Arrange
var response = "{\"result\":[{\"msg_ver\":8,\"msg_seq\":54,\"state\":8,\"battery\":100,\"clean_time\":729,\"clean_area\":9795000,\"error_code\":0,\"map_present\":1,\"in_cleaning\":0,\"fan_power\":60,\"dnd_enabled\":0}],\"id\":6}\0";
var miioDevice = GetMiioDevice("get_status", response);
Expand Down Expand Up @@ -210,4 +214,4 @@ public async Task SpotAsync_Should_Now_Throw_ExceptionsAsync()
miioDevice.Verify(x => x.SendMessageAsync("{\"id\": 1, \"method\": \"app_spot\", \"params\": [\"\"]}"), Times.Once());
}
}
}
}

0 comments on commit 5922f64

Please sign in to comment.