This commit is contained in:
MikhailArkhipov 2017-11-29 11:39:33 -08:00
Родитель 86160ee2f9
Коммит 26126b19f0
3 изменённых файлов: 25 добавлений и 28 удалений

Просмотреть файл

@ -7,9 +7,7 @@ using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.UnitTests.Core.XUnit;
using Microsoft.VisualStudio.R.Package.Shell;
using Microsoft.VisualStudio.Settings;
using Microsoft.VisualStudio.Shell.Mocks;
using NSubstitute;
namespace Microsoft.VisualStudio.R.Package.Test.Settings {
[ExcludeFromCodeCoverage]
@ -26,9 +24,7 @@ namespace Microsoft.VisualStudio.R.Package.Test.Settings {
await SaveRestoreAsync("name", new TestSetting("p1", 1));
}
public async Task SaveRestoreAsync<T>(string name, T value) {
var sm = Substitute.For<ISettingsManager>();
private async Task SaveRestoreAsync<T>(string name, T value) {
var storage = new VsSettingsStorage(new VsSettingsPersistenceManagerMock());
storage.SettingExists(name).Should().BeFalse();
storage.SetSetting(name, value);
@ -42,7 +38,7 @@ namespace Microsoft.VisualStudio.R.Package.Test.Settings {
storage.GetSetting(name, value.GetType()).Should().Be(value);
}
class TestSetting {
private class TestSetting {
public string Prop1 { get; set; }
public int Prop2 { get; set; }

Просмотреть файл

@ -210,27 +210,27 @@ namespace Microsoft.VisualStudio.R.Interactive.Test.Data {
// Tibble-like objects are collections that, when sliced with [], always return
// result of the same shape, even if it's only one row or one column.
//[Test]
public Task TibbleLikeGrid() => Test(@"local({
attach(as.environment(list(`[.tibble` = function(x, row, col, drop = TRUE) {
class(x) <- NULL
h <- if (missing(row)) dim(x)[[1]] else length(row)
w <- if (missing(col)) dim(x)[[2]] else length(col)
x <- x[row, col]
dim(x) <- c(h, w)
class(x) <- 'tibble'
x
})))
//public Task TibbleLikeGrid() => Test(@"local({
// attach(as.environment(list(`[.tibble` = function(x, row, col, drop = TRUE) {
// class(x) <- NULL
// h <- if (missing(row)) dim(x)[[1]] else length(row)
// w <- if (missing(col)) dim(x)[[2]] else length(col)
// x <- x[row, col]
// dim(x) <- c(h, w)
// class(x) <- 'tibble'
// x
// })))
tibble <- 1:12
dim(tibble) <- c(4, 3)
class(tibble) <- 'tibble'
tibble
})", 2, 1, new[,] {
{ null, "[,1]", "[,2]" },
{ "[2,]", "2", "6" },
{ "[3,]", "3", "7" },
{ "[4,]", "4", "8" },
});
// tibble <- 1:12
// dim(tibble) <- c(4, 3)
// class(tibble) <- 'tibble'
// tibble
// })", 2, 1, new[,] {
// { null, "[,1]", "[,2]" },
// { "[2,]", "2", "6" },
// { "[3,]", "3", "7" },
// { "[4,]", "4", "8" },
//});
[Test]
public Task MatrixGrid() => Test("matrix(1:20, 5, 4)", 2, 2, new[,] {

Просмотреть файл

@ -9,10 +9,11 @@
<Import Project="..\..\..\R.Settings.props" />
<PropertyGroup>
<DebugType>portable</DebugType>
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\..\AssemblyVersionInfo.cs" Link="Properties\AssemblyVersionInfo.cs" />
<Compile Include="..\..\..\GlobalAssemblyInfo.cs" Link="Properties\GlobalAssemblyInfo.cs" />
<Compile Include="$(SourceDirectory)AssemblyVersionInfo.cs" Link="Properties\AssemblyVersionInfo.cs" />
<Compile Include="$(SourceDirectory)GlobalAssemblyInfo.cs" Link="Properties\GlobalAssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>