Permalink
Browse files

spaces -> tabs

  • Loading branch information...
1 parent 1707adb commit e6ab5a0d1c6c7a8f55424dc3f224614b41800223 @ayende ayende committed Jan 30, 2012
@@ -217,10 +217,10 @@ private void Out(string s)
private void OutMember(Expression instance, MemberInfo member)
{
- if (instance == null || instance.NodeType != ExpressionType.MemberAccess)
- {
- OutputTypeIfNeeded(member);
- }
+ if (instance == null || instance.NodeType != ExpressionType.MemberAccess)
+ {
+ OutputTypeIfNeeded(member);
+ }
var name = member.Name;
if (translateIdentityProperty &&
convention.GetIdentityProperty(member.DeclaringType) == member &&
@@ -251,10 +251,10 @@ private void OutMember(Expression instance, MemberInfo member)
Out(member.DeclaringType.Name + "." + name);
}
- if (instance == null || instance.NodeType != ExpressionType.MemberAccess)
- {
- CloseOutputTypeIfNeeded(member);
- }
+ if (instance == null || instance.NodeType != ExpressionType.MemberAccess)
+ {
+ CloseOutputTypeIfNeeded(member);
+ }
}
private void CloseOutputTypeIfNeeded(MemberInfo member)
@@ -4,67 +4,67 @@
namespace Raven.Tests.Bugs.MultiMap
{
- public class MultiMapWithCustomProperties : RavenTest
- {
- [Fact]
- public void Can_create_index()
- {
- using (var store = NewDocumentStore())
- {
- using (var session = store.OpenSession())
- {
- session.Store(new Cat { Name = "Tom", CatsOnlyProperty = "Miau"});
- session.Store(new Dog { Name = "Oscar" });
+ public class MultiMapWithCustomProperties : RavenTest
+ {
+ [Fact]
+ public void Can_create_index()
+ {
+ using (var store = NewDocumentStore())
+ {
+ using (var session = store.OpenSession())
+ {
+ session.Store(new Cat { Name = "Tom", CatsOnlyProperty = "Miau" });
+ session.Store(new Dog { Name = "Oscar" });
- session.SaveChanges();
- }
+ session.SaveChanges();
+ }
- new CatsAndDogs().Execute(store);
+ new CatsAndDogs().Execute(store);
- WaitForIndexing(store);
+ WaitForIndexing(store);
- Assert.Empty(store.DocumentDatabase.Statistics.Errors);
+ Assert.Empty(store.DocumentDatabase.Statistics.Errors);
- using(var s = store.OpenSession())
+ using (var s = store.OpenSession())
{
Assert.NotEmpty(s.Query<Cat, CatsAndDogs>()
- .Where(x => x.CatsOnlyProperty == "Miau")
- .ToList());
+ .Where(x => x.CatsOnlyProperty == "Miau")
+ .ToList());
Assert.NotEmpty(s.Query<Dog, CatsAndDogs>()
.Where(x => x.Name == "Oscar")
.ToList());
}
- }
- }
+ }
+ }
- public class CatsAndDogs : AbstractMultiMapIndexCreationTask
- {
- public CatsAndDogs()
- {
- AddMap<Cat>(cats => from cat in cats
- select new { cat.Name, cat.CatsOnlyProperty });
+ public class CatsAndDogs : AbstractMultiMapIndexCreationTask
+ {
+ public CatsAndDogs()
+ {
+ AddMap<Cat>(cats => from cat in cats
+ select new { cat.Name, cat.CatsOnlyProperty });
- AddMap<Dog>(dogs => from dog in dogs
- select new { dog.Name, CatsOnlyProperty = (string)null });
- }
- }
+ AddMap<Dog>(dogs => from dog in dogs
+ select new { dog.Name, CatsOnlyProperty = (string)null });
+ }
+ }
- public interface IHaveName
- {
- string Name { get; }
- }
+ public interface IHaveName
+ {
+ string Name { get; }
+ }
- public class Cat : IHaveName
- {
- public string Name { get; set; }
- public string CatsOnlyProperty { get; set; }
- }
+ public class Cat : IHaveName
+ {
+ public string Name { get; set; }
+ public string CatsOnlyProperty { get; set; }
+ }
- public class Dog : IHaveName
- {
- public string Name { get; set; }
- }
- }
+ public class Dog : IHaveName
+ {
+ public string Name { get; set; }
+ }
+ }
}
@@ -7,14 +7,14 @@ public class AnswerVote
public string QuestionId { get; set; }
public string AnswerId { get; set; }
public int Delta { get; set; }
- public decimal DecimalValue { get; set; }
+ public decimal DecimalValue { get; set; }
}
public class AnswerVote2
{
public Guid Id { get; set; }
public Guid QuestionId { get; set; }
public Guid AnswerId { get; set; }
public int Delta { get; set; }
- }
+ }
}
@@ -8,13 +8,13 @@ public class Answers_ByQuestion : AbstractIndexCreationTask<AnswerVote, AnswerVi
public Answers_ByQuestion()
{
Map = docs => from doc in docs
- select new
- {
- AnswerId = doc.AnswerId,
- QuestionId = doc.QuestionId,
- VoteTotal = doc.Delta,
- DecimalTotal = doc.DecimalValue
- };
+ select new
+ {
+ AnswerId = doc.AnswerId,
+ QuestionId = doc.QuestionId,
+ VoteTotal = doc.Delta,
+ DecimalTotal = doc.DecimalValue
+ };
Reduce = mapped => from map in mapped
group map by new
@@ -27,7 +27,7 @@ select new
AnswerId = g.Key.AnswerId,
QuestionId = g.Key.QuestionId,
VoteTotal = g.Sum(x => x.VoteTotal),
- DecimalTotal = g.Sum(x => x.DecimalTotal)
+ DecimalTotal = g.Sum(x => x.DecimalTotal)
};
TransformResults = (database, results) =>
@@ -42,7 +42,7 @@ select new
UserId = answer.UserId,
UserDisplayName = user.DisplayName,
VoteTotal = result.VoteTotal,
- result.DecimalTotal
+ result.DecimalTotal
};
this.IndexSortOptions.Add(x => x.VoteTotal, Raven.Abstractions.Indexing.SortOptions.Int);
}
@@ -110,35 +110,35 @@ public void CanExecuteTheTransformResultFunction()
}
}
- [Fact]
- public void DecimalValues()
- {
- using (EmbeddableDocumentStore documentStore = NewDocumentStore())
- {
- new Answers_ByQuestion().Execute(documentStore);
-
- const string questionId = @"question\259";
- using (IDocumentSession session = documentStore.OpenSession())
- {
- var vote1 = new AnswerVote { QuestionId = questionId, Delta = 2, DecimalValue = 20};
- session.Store(vote1);
- var vote2 = new AnswerVote { QuestionId = questionId, Delta = 3, DecimalValue = 43};
- session.Store(vote2);
-
- session.SaveChanges();
- }
-
- using (IDocumentSession session = documentStore.OpenSession())
- {
- AnswerViewItem questionInfo = session.Query<AnswerViewItem, Answers_ByQuestion>()
- .Customize(x => x.WaitForNonStaleResultsAsOfNow())
- .Where(x => x.QuestionId == questionId)
- .SingleOrDefault();
- Assert.NotNull(questionInfo);
- Assert.Equal(63, questionInfo.DecimalTotal);
- }
- }
- }
+ [Fact]
+ public void DecimalValues()
+ {
+ using (EmbeddableDocumentStore documentStore = NewDocumentStore())
+ {
+ new Answers_ByQuestion().Execute(documentStore);
+
+ const string questionId = @"question\259";
+ using (IDocumentSession session = documentStore.OpenSession())
+ {
+ var vote1 = new AnswerVote { QuestionId = questionId, Delta = 2, DecimalValue = 20 };
+ session.Store(vote1);
+ var vote2 = new AnswerVote { QuestionId = questionId, Delta = 3, DecimalValue = 43 };
+ session.Store(vote2);
+
+ session.SaveChanges();
+ }
+
+ using (IDocumentSession session = documentStore.OpenSession())
+ {
+ AnswerViewItem questionInfo = session.Query<AnswerViewItem, Answers_ByQuestion>()
+ .Customize(x => x.WaitForNonStaleResultsAsOfNow())
+ .Where(x => x.QuestionId == questionId)
+ .SingleOrDefault();
+ Assert.NotNull(questionInfo);
+ Assert.Equal(63, questionInfo.DecimalTotal);
+ }
+ }
+ }
[Fact]
public void write_then_read_from_stack_over_flow_types()

0 comments on commit e6ab5a0

Please sign in to comment.