Skip to content

Commit

Permalink
Merge pull request #57 from DynamicsValue/feature/licensing-tweaks
Browse files Browse the repository at this point in the history
Change UserReader implementation for consistency with v3. Remove lega…
  • Loading branch information
jordimontana82 authored Feb 3, 2024
2 parents c47133b + e49ef22 commit 6aa6746
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- **Alpha**: Introduced subscription usage monitoring based on customer feedback

### Changed

- Remove ReleaseNotes from package description - https://github.com/DynamicsValue/fake-xrm-easy/issues/115

## [2.3.3]

### Added
Expand Down
4 changes: 3 additions & 1 deletion src/FakeXrmEasy.Core/CommercialLicense/UserReader.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace FakeXrmEasy.Core.CommercialLicense
{
/// <summary>
Expand All @@ -16,7 +18,7 @@ internal class UserReader: IUserReader
{
public string GetCurrentUserName()
{
return System.Security.Principal.WindowsIdentity.GetCurrent().Name;
return Environment.UserName;
}
}
}
4 changes: 0 additions & 4 deletions src/FakeXrmEasy.Core/FakeXrmEasy.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@
<PropertyGroup>
<PackageDescription>
FakeXrmEasy is the open source test automation framework for .net core and the Power Platform. This is the core package containing a configurable middleware, crud operators, and query translation between FetchXml, QueryExpression, CRM LINQ, and QueryByAttribute.

RELEASE NOTES
------------------
@(ReleaseNoteLines, '%0a')
</PackageDescription>
<PackageReleaseNotes>@(ReleaseNoteLines, '%0a')</PackageReleaseNotes>
</PropertyGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/FakeXrmEasy.Core/XrmFakedTracingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public void Trace(string format, params object[] args)
}
else
{
Console.WriteLine(format, args);

_trace.AppendLine(string.Format(format, args));
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using FakeXrmEasy.Core.CommercialLicense;
using Xunit;

Expand All @@ -15,7 +16,7 @@ public UserReaderTests()
[Fact]
public void Should_return_current_user()
{
Assert.Equal(System.Security.Principal.WindowsIdentity.GetCurrent().Name, _userReader.GetCurrentUserName());
Assert.Equal(Environment.UserName, _userReader.GetCurrentUserName());
}
}
}
1 change: 0 additions & 1 deletion tests/FakeXrmEasy.Core.Tests/Issues/Issue191.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public void Testing_191()
link2.LinkEntities.Add(link22);

var count2 = _service.RetrieveMultiple(query2).Entities.Count;
Console.WriteLine(count2); // returns 1 record

var results = _service.RetrieveMultiple(query2);
Assert.True(results.Entities[0].Attributes.ContainsKey("child1.contactid"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2101,18 +2101,8 @@ public void FetchXml_Operator_This_Week_Execution()
var today = DateTime.Today;
var date = today;

var firstDayOfWeek = (int)CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;

Console.WriteLine($"First day of week={firstDayOfWeek}");

var dayOfWeek = (int)date.DayOfWeek;
Console.WriteLine($"Day of week={dayOfWeek}");

var firstDayOfThisWeek = GetFirstDayOfWeek(date);
Console.WriteLine($"First day of this week={firstDayOfThisWeek}");

var lastDayOfThisWeek = firstDayOfThisWeek.AddDays(6);
Console.WriteLine($"last day of this week={lastDayOfThisWeek}");

var ct1 = new Contact() { Id = Guid.NewGuid(), Anniversary = firstDayOfThisWeek }; //Should be returned
var ct2 = new Contact() { Id = Guid.NewGuid(), Anniversary = lastDayOfThisWeek }; //Should be returned
Expand Down

0 comments on commit 6aa6746

Please sign in to comment.