This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ConversationQueryable<T> : IQueryable<T> | |
{ | |
private readonly IConversationsContainerAccessor _conversationsContainerAccessor; | |
private readonly IQueryable<T> _realQueryable; | |
public ConversationQueryable( | |
IConversationsContainerAccessor conversationsContainerAccessor, | |
IQueryable<T> realQueryable) | |
{ | |
_conversationsContainerAccessor = conversationsContainerAccessor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using NUnit.Framework; | |
using SGF.Data.Impl.Constraints.CustomConstraints; | |
using SharpTestsEx; | |
namespace SGF.Domain.Constraints.Test | |
{ | |
[TestFixture] | |
public class GenderGuesserTests | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using NUnit.Framework; | |
using SGF.Data.Impl.Constraints.CustomConstraints; | |
using SharpTestsEx; | |
namespace SGF.Domain.Constraints.Test | |
{ | |
[TestFixture] | |
public class GenderGuesserTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// </summary> | |
/// <remarks> There is a lot of useless information | |
/// in <see cref="http://buscon.rae.es/dpdI/SrvltGUIBusDPD?lema=g%E9nero2">RAE.</see></remarks> | |
public class GenderGuesser | |
{ | |
private const string LastVocalPattern = @"(?<vocal>[aeiouáéíóú])[^aeiouáéíóú]*\z"; | |
private static readonly string[] femaleEndings = new[] | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string Do<TCollectionElement>(Expression<Func<T, IEnumerable<TCollectionElement>>> property) | |
{ | |
return "a"; | |
} | |
public int Do<TPropertyType>(Expression<Func<T, TPropertyType>> property) | |
{ | |
return 5; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PersonValidationDef : ValidationDef<AsientoContableLinea> | |
{ | |
public PersonValidationDef() | |
{ | |
//Si bien puedo hacer esto, no tengo forma de separar | |
//la validacion IsMale. (bueno podría creando un validador) | |
ValidateInstance.By(p => p.Father.IsMale) | |
.WithMessage("Father must be male."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// No Metadata Documentation available. | |
/// </summary> | |
[EdmEntityTypeAttribute(NamespaceName="Model1", Name="Prueba")] | |
[Serializable()] | |
[DataContractAttribute(IsReference=true)] | |
public partial class Prueba : EntityObject | |
{ | |
#region Factory Method | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IPaginatorModel<TEntity> where TEntity : Entity | |
{ | |
ICollection<TEntity> GetPage(int pageSize, | |
int pageNumber, | |
Expression<Func<TEntity, bool>> filterFunction, | |
Func<TEntity, object> sortFunction); | |
int GetPageCount(int pageSize, | |
Expression<Func<TEntity, bool>> filterFunction); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
using System.Windows.Input; | |
using Mantenimiento.Domain.Model.InterfacesBase; | |
using uNhAddIns.Entities; | |
namespace Mantenimiento.ViewModels.BaseClasses | |
{ | |
public abstract class ViewModelPaginado<T> : ViewModelBase where T : Entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void no_puede_ir_a_siguiente_ni_ultimo_si_esta_en_ultima_pagina() | |
{ | |
var model = new Mock<IModeloListar<Articulo>>(); | |
var segundaPagina = new List<Articulo> {new Articulo {Nombre = "bbb"}}; | |
model.Setup(m => m.ObtenerPagina(Constantes.TAMANIO_PAGINA, 0, It.IsAny<Expression<Func<Articulo, bool>>>())) | |
.ReturnsInOrder(segundaPagina); | |
model.Setup(m => m.ObtenerUltimaPagina(Constantes.TAMANIO_PAGINA, It.IsAny<Expression<Func<Articulo, bool>>>())) |